mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-06 03:50:19 +02:00
AbstractBook.matches(pattern) does not use File object
This commit is contained in:
parent
a8626f8972
commit
93f807f953
1 changed files with 12 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue