[FIX] Используем String,join для FileNameMatcher

This commit is contained in:
Gravit 2019-02-27 08:34:29 +07:00
parent 0495c26546
commit bda1913ca0

View file

@ -11,13 +11,14 @@ public final class FileNameMatcher {
private static boolean anyMatch(String[] entries, Collection<String> path) { private static boolean anyMatch(String[] entries, Collection<String> path) {
//return path.stream().anyMatch(e -> Arrays.stream(entries).anyMatch(p -> p.endsWith(e))); //return path.stream().anyMatch(e -> Arrays.stream(entries).anyMatch(p -> p.endsWith(e)));
String jpath = String.join("/", path);
for(String e : entries) for(String e : entries)
{ {
String[] split = e.split("/"); /*String[] split = e.split("/");
int index = 0; //int index = 0;
for(String p : path) //for(String p : path)
{ //{
if(index>=split.length) // if(index>=split.length)
{ {
return true; return true;
} }
@ -25,7 +26,8 @@ private static boolean anyMatch(String[] entries, Collection<String> path) {
break; break;
} }
index++; index++;
} }*/
if(jpath.startsWith(e)) return true;
} }
return false; return false;
} }