Skip to content

Instantly share code, notes, and snippets.

@scriptnull
Created October 26, 2013 19:18
Show Gist options
  • Save scriptnull/7173448 to your computer and use it in GitHub Desktop.
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
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