Last active
March 16, 2018 08:38
-
-
Save haies/0891f11ebc5ceadbd3400f5a3639e55c to your computer and use it in GitHub Desktop.
getFilterFiles
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
| private File[] getFilterFiles(String path, String[] suffix) { | |
| File baseFolder = new File(path); | |
| if(!baseFolder.isDirectory())return null; | |
| FileFilter imageFilter = pathname -> { | |
| String fileName = pathname.getName().toLowerCase(); | |
| for (String s : suffix) { | |
| if (fileName.endsWith(s.toLowerCase())) return true; | |
| } | |
| return false; | |
| }; | |
| return baseFolder.listFiles(imageFilter); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment