parent
48b4f976df
commit
536f6b9a50
|
|
@ -19,6 +19,7 @@ import java.nio.file.FileSystem;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
public class ModernFixResourceFinder {
|
public class ModernFixResourceFinder {
|
||||||
|
|
@ -99,7 +100,10 @@ public class ModernFixResourceFinder {
|
||||||
throw new UnsupportedOperationException("Unknown ModLocator type: " + locator.getClass().getName());
|
throw new UnsupportedOperationException("Unknown ModLocator type: " + locator.getClass().getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final Pattern SLASH_REPLACER = Pattern.compile("/+");
|
||||||
|
|
||||||
public static Enumeration<URL> findAllURLsForResource(String input) {
|
public static Enumeration<URL> findAllURLsForResource(String input) {
|
||||||
|
input = SLASH_REPLACER.matcher(input).replaceAll("/");
|
||||||
List<URL> urlList = urlsForClass.get(input);
|
List<URL> urlList = urlsForClass.get(input);
|
||||||
if(urlList != null)
|
if(urlList != null)
|
||||||
return Collections.enumeration(urlList);
|
return Collections.enumeration(urlList);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user