Created
October 26, 2013 19:18
-
-
Save scriptnull/7173448 to your computer and use it in GitHub Desktop.
java snippet to list all the file names available in a folder path
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
public class Main { | |
public static void main(String[] args) throws Exception { | |
File folder = new File("C:/"); //folder path | |
File[] myf = folder.listFiles(); | |
for(File a : myf) | |
{ | |
System.out.println(a.getName()); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment