Update exclusions

I have changed how exclusions are done. Rather than a multi-boolean if statement it now iderates over an array with the exclusions as it's positions.
This commit is contained in:
manfromhuh 2021-08-06 14:52:18 -04:00
parent 023a537ffc
commit 9fe9469441

View File

@ -43,17 +43,19 @@ public class Picture_Lister {
@Override
public boolean accept(File dir, String name) {
if(name.lastIndexOf('.')>0) {
String[] exclude = {".png",".jpg"};
// get last index for '.' char
int lastIndex = name.lastIndexOf('.');
// get extension
String str = name.substring(lastIndex);
// match path name extension
if(str.equals(".png") || str.equals(".jpg")) {
return true;
}
// match path name extension
for (String place_holder : exclude) {
if (str.equalsIgnoreCase(place_holder)) {
return true;
}
}
}
return false;