Author: lukaszlenart
Date: Tue Feb 19 14:47:00 2013
New Revision: 1447738

URL: http://svn.apache.org/r1447738
Log:
WW-3984 Adds support for URLs which are already normalized to file protocol

Modified:
    
struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/fs/DefaultFileManager.java

Modified: 
struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/fs/DefaultFileManager.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/fs/DefaultFileManager.java?rev=1447738&r1=1447737&r2=1447738&view=diff
==============================================================================
--- 
struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/fs/DefaultFileManager.java
 (original)
+++ 
struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/fs/DefaultFileManager.java
 Tue Feb 19 14:47:00 2013
@@ -123,12 +123,17 @@ public class DefaultFileManager implemen
             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;
         }


Reply via email to