Created
June 23, 2015 13:29
-
-
Save kevinrobayna/9ddd36f61183dca055d2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
File folder = new File("your/path"); | |
File[] listOfFiles = folder.listFiles(); | |
for (int i = 0; i < listOfFiles.length; i++) { | |
if (listOfFiles[i].isFile()) { | |
System.out.println("File " + listOfFiles[i].getName()); | |
} else if (listOfFiles[i].isDirectory()) { | |
System.out.println("Directory " + listOfFiles[i].getName()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment