This commit is contained in:
Phillip Webb
2016-04-10 21:27:32 -07:00
parent 7709352c2d
commit 6d23ce2ada
2 changed files with 8 additions and 8 deletions

View File

@@ -66,20 +66,16 @@ public abstract class ResourceUtils {
* @return a list of URLs
*/
public static List<String> getUrls(String path, ClassLoader classLoader) {
if (classLoader == null) {
classLoader = ClassUtils.getDefaultClassLoader();
}
path = StringUtils.cleanPath(path);
try {
return getUrlsFromWildcardPath(path, classLoader);
}
catch (Exception ex) {
throw new IllegalArgumentException(
"Cannot create URL from path [" + path + "]", ex);
}
}
@@ -88,7 +84,6 @@ public abstract class ResourceUtils {
if (path.contains(":")) {
return getUrlsFromPrefixedWildcardPath(path, classLoader);
}
Set<String> result = new LinkedHashSet<String>();
try {
result.addAll(getUrls(FILE_URL_PREFIX + path, classLoader));
@@ -96,7 +91,6 @@ public abstract class ResourceUtils {
catch (IllegalArgumentException ex) {
// ignore
}
path = stripLeadingSlashes(path);
result.addAll(getUrls(ALL_CLASSPATH_URL_PREFIX + path, classLoader));
return new ArrayList<String>(result);