|
|
@ -115,7 +115,7 @@ public abstract class ResourceUtils {
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
result.add(resource.getURL().toExternalForm());
|
|
|
|
result.add(absolutePath(resource));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
@ -127,12 +127,19 @@ public abstract class ResourceUtils {
|
|
|
|
List<String> childFiles = new ArrayList<String>();
|
|
|
|
List<String> childFiles = new ArrayList<String>();
|
|
|
|
for (Resource child : children) {
|
|
|
|
for (Resource child : children) {
|
|
|
|
if (!child.getFile().isDirectory()) {
|
|
|
|
if (!child.getFile().isDirectory()) {
|
|
|
|
childFiles.add(child.getURL().toExternalForm());
|
|
|
|
childFiles.add(absolutePath(child));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return childFiles;
|
|
|
|
return childFiles;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static String absolutePath(Resource resource) throws IOException {
|
|
|
|
|
|
|
|
if (!resource.getURI().getScheme().equals("file")) {
|
|
|
|
|
|
|
|
return resource.getURL().toExternalForm();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return resource.getFile().getAbsoluteFile().toURI().toString();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private static String stripLeadingSlashes(String path) {
|
|
|
|
private static String stripLeadingSlashes(String path) {
|
|
|
|
while (path.startsWith("/")) {
|
|
|
|
while (path.startsWith("/")) {
|
|
|
|
path = path.substring(1);
|
|
|
|
path = path.substring(1);
|
|
|
|