Created
November 17, 2014 21:24
-
-
Save shiffman/7b4c3b06f02101bbe050 to your computer and use it in GitHub Desktop.
List without DS_Store
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
| String[] listFileNames(String dir) { | |
| File file = new File(dir); | |
| if (file.isDirectory()) { | |
| String names[] = file.list(); | |
| StringList filelist = new StringList(); | |
| for (String s : names) { | |
| if (!s.contains("DS_Store")) { | |
| filelist.append(s); | |
| } | |
| } | |
| return filelist.array(); | |
| } else { | |
| // If it's not a directory | |
| return null; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment