mirror of
https://github.com/apache/struts.git
synced 2026-08-07 15:46:57 +00:00
WW-4679 Handles empty space in path
This commit is contained in:
+3
-3
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user