Repository: struts Updated Branches: refs/heads/master 459e19802 -> c570a2b2b
WW-4679 Handles empty space in path Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/c570a2b2 Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/c570a2b2 Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/c570a2b2 Branch: refs/heads/master Commit: c570a2b2bda34632760f69e84c3877a6004c855b Parents: 459e198 Author: Lukasz Lenart <lukaszlen...@apache.org> Authored: Fri Sep 16 16:45:27 2016 +0200 Committer: Lukasz Lenart <lukaszlen...@apache.org> Committed: Fri Sep 16 16:45:27 2016 +0200 ---------------------------------------------------------------------- .../struts2/tiles/StrutsWildcardServletApplicationContext.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/struts/blob/c570a2b2/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsWildcardServletApplicationContext.java ---------------------------------------------------------------------- diff --git a/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsWildcardServletApplicationContext.java b/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsWildcardServletApplicationContext.java index df6152b..abe90aa 100644 --- a/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsWildcardServletApplicationContext.java +++ b/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsWildcardServletApplicationContext.java @@ -31,7 +31,6 @@ import javax.servlet.ServletContext; import java.io.File; import java.io.IOException; import java.net.MalformedURLException; -import java.net.URI; import java.net.URL; import java.util.Collection; import java.util.Enumeration; @@ -100,9 +99,10 @@ public class StrutsWildcardServletApplicationContext extends ServletApplicationC public ApplicationResource getResource(ApplicationResource base, Locale locale) { String localePath = base.getLocalePath(locale); - if (new File(localePath).exists()) { + File localFile = new File(localePath); + if (localFile.exists()) { try { - return new StrutsApplicationResource(URI.create("file://" + localePath).toURL()); + return new StrutsApplicationResource(localFile.toURI().toURL()); } catch (MalformedURLException e) { LOG.warn("Cannot access [{}]", localePath, e); return null;