mirror of
https://github.com/apache/struts.git
synced 2026-08-07 15:46:57 +00:00
WW-3984 Adds support for URLs which are already normalized to file protocol
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1447738 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -123,12 +123,17 @@ public class DefaultFileManager implements FileManager {
|
||||
if (jarMatcher.matches()) {
|
||||
String path = jarMatcher.group(JAR_FILE_PATH);
|
||||
return new URL("file", "", path);
|
||||
} else if ("file".equals(url.getProtocol())) {
|
||||
return url; // it's already a file
|
||||
} else {
|
||||
return null; //it is not a jar or zip file
|
||||
if (LOG.isWarnEnabled()) {
|
||||
LOG.warn("Could not normalize URL [#0] to file protocol!", url.toString());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
} catch (MalformedURLException e) {
|
||||
if (LOG.isWarnEnabled()) {
|
||||
LOG.warn("Error opening url [#0]", e, url.toString());
|
||||
LOG.warn("Error normalizing URL [#0] to file protocol!", e, url.toString());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user