parent
0a9644a8a0
commit
213bcd1b2a
|
|
@ -92,7 +92,20 @@ public class ModernFixResourceFinder {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Enumeration<URL> findAllURLsForResource(String input) {
|
public static Enumeration<URL> findAllURLsForResource(String input) {
|
||||||
// CachedResourcePath normalizes already
|
// CachedResourcePath normalizes already but we need to strip trailing slash if any
|
||||||
|
// TODO move logic to FileUtil.normalize()
|
||||||
|
int lastIndex = input.length();
|
||||||
|
boolean strip = false;
|
||||||
|
while(lastIndex > 1) {
|
||||||
|
char c = input.charAt(lastIndex - 1);
|
||||||
|
if (c == '/' || c == '\\') {
|
||||||
|
lastIndex--;
|
||||||
|
strip = true;
|
||||||
|
} else
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if(strip)
|
||||||
|
input = input.substring(0, lastIndex);
|
||||||
Collection<String> urlList = urlsForClass.get(new CachedResourcePath(input));
|
Collection<String> urlList = urlsForClass.get(new CachedResourcePath(input));
|
||||||
if(!urlList.isEmpty()) {
|
if(!urlList.isEmpty()) {
|
||||||
String pathInput = FileUtil.normalize(input);
|
String pathInput = FileUtil.normalize(input);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user