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:
parent
023a537ffc
commit
9fe9469441
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user