Lines 193-204
Link Here
|
193 |
* @see javax.servlet.ServletContext#getResource(java.lang.String) |
193 |
* @see javax.servlet.ServletContext#getResource(java.lang.String) |
194 |
*/ |
194 |
*/ |
195 |
public URL getResource(String path) throws MalformedURLException { |
195 |
public URL getResource(String path) throws MalformedURLException { |
196 |
boolean hostOnly = false; |
196 |
if (path == null) { |
|
|
197 |
throw new MalformedURLException(String.format("'%s' is not a valid resource path", path)); |
198 |
} |
199 |
|
200 |
boolean hostOnly = false; |
197 |
if (path.startsWith(HOST_PATH_PREFIX)) { |
201 |
if (path.startsWith(HOST_PATH_PREFIX)) { |
198 |
path = path.substring(HOST_PATH_PREFIX.length()); |
202 |
path = path.substring(HOST_PATH_PREFIX.length()); |
199 |
hostOnly = true; |
203 |
hostOnly = true; |
200 |
} |
204 |
} |
201 |
if (path == null || !path.startsWith("/")) { |
205 |
if (!path.startsWith("/")) { |
202 |
throw new MalformedURLException(String.format("'%s' is not a valid resource path", path)); |
206 |
throw new MalformedURLException(String.format("'%s' is not a valid resource path", path)); |
203 |
} |
207 |
} |
204 |
if (hostOnly) { |
208 |
if (hostOnly) { |