1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-06 12:00:17 +02:00

AbstractBook.matches(pattern) does not use File object

This commit is contained in:
Nikolay Pultsin 2015-05-23 16:16:42 +01:00
parent a8626f8972
commit 93f807f953

View file

@ -367,7 +367,18 @@ public abstract class AbstractBook extends TitledEntity<AbstractBook> {
}
}
}
if (MiscUtil.matchesIgnoreCase(File.getLongName(), pattern)) {
String fileName = getPath();
// first archive delimiter
int index = fileName.indexOf(":");
// last path delimiter before first archive delimiter
if (index == -1) {
index = fileName.lastIndexOf("/");
} else {
index = fileName.lastIndexOf("/", index);
}
fileName = fileName.substring(index + 1);
if (MiscUtil.matchesIgnoreCase(fileName, pattern)) {
return true;
}
return false;