mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 11:39:11 +03:00
[FIX] Issue #179
This commit is contained in:
parent
616aa951bc
commit
0819dabc69
1 changed files with 13 additions and 3 deletions
|
@ -1,6 +1,7 @@
|
|||
package ru.gravit.launcher.hasher;
|
||||
|
||||
import ru.gravit.launcher.LauncherAPI;
|
||||
import ru.gravit.utils.helper.LogHelper;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
@ -10,11 +11,20 @@ public final class FileNameMatcher {
|
|||
|
||||
private static boolean anyMatch(String[] entries, Collection<String> path) {
|
||||
//return path.stream().anyMatch(e -> Arrays.stream(entries).anyMatch(p -> p.endsWith(e)));
|
||||
for(String p : path)
|
||||
{
|
||||
for(String e : entries)
|
||||
{
|
||||
if(p.endsWith(e)) return true;
|
||||
String[] split = e.split("/");
|
||||
int index = 0;
|
||||
for(String p : path)
|
||||
{
|
||||
if(index>=split.length)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if(!p.equals(split[index])) {
|
||||
break;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue