[FIX] Issue #179

This commit is contained in:
Gravit 2019-02-24 20:59:26 +07:00
parent 616aa951bc
commit 0819dabc69
No known key found for this signature in database
GPG key ID: 061981E1E85D3216

View file

@ -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;