Commits

Anonymous committed 1c4743c

XW-611 DefaultValidatorFactory call to URL.toURI() doesn't allow paths that contain spaces
o applied suggested patch
submitted by: rod@vagg.org

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk@1761e221344d-f017-0410-9bd5-d282ab1896d7

Comments (0)

Files changed (1)

src/java/com/opensymphony/xwork2/validator/DefaultValidatorFactory.java

 import java.io.IOException;
 import java.net.URISyntaxException;
 import java.net.URL;
+import java.net.URI;
 import java.util.*;
 
 import com.opensymphony.xwork2.ObjectFactory;
             Iterator<URL> urls = ClassLoaderUtil.getResources("", DefaultValidatorFactory.class, false);
             while (urls.hasNext()) {
                 URL u = urls.next();
-                File f = new File(u.toURI());
+                File f = new File(new URI(u.toExternalForm().replaceAll(" ", "%20"))); 
                 FilenameFilter filter = new FilenameFilter() {
                     public boolean accept(File file, String fileName) {
                         return fileName.contains("-validators.xml");