Commits

Anonymous committed fd92b21

Comments (0)

Files changed (1)

src/java/com/opensymphony/xwork2/util/FileManager.java

 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URL;
+import java.net.URISyntaxException;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
         if (isReloadingConfigs()) {
             if (!fileName.startsWith(JAR_FILE_NAME_PREFIX)) {
 
-                File file = new File(fileUrl.getFile());
+                File file;
+                try {
+                    file = new File(fileUrl.toURI());
+                } catch (URISyntaxException e) {
+                    file = new File(fileUrl.getPath());
+                }
                 long lastModified;
 
                 if (!file.exists() || !file.canRead()) {
                     files.put(fileName, new FileRevision(file, lastModified));
                 } else {
                     // Never expire a non-file resource
-                    files.put(fileName, new FileRevision());
+                    files.put(fileName, new Revision());
                 }
             }  else {
                 // File within a Jar
         private File file;
         private long lastModified;
 
-        public FileRevision() {
-        }
-
         public FileRevision(File file, long lastUpdated) {
             if (file == null) {
                 throw new IllegalArgumentException("File cannot be null");
         }
 
         public boolean needsReloading() {
-            return (this.file != null) && (this.lastModified < this.file.lastModified());
+            return this.lastModified < this.file.lastModified();
         }
 
     }