public class ServletContextURLContainer extends java.lang.Object implements URLContainer
Constructor and Description |
---|
ServletContextURLContainer(javax.servlet.ServletContext servletContext) |
Modifier and Type | Method and Description |
---|---|
java.net.URL |
getResource(java.lang.String name)
Returns the resource with the given name.
|
java.util.Set<java.lang.String> |
getResources(java.lang.String path)
Returns the directory-like listing of all the paths to resources within
the container whose longest sub-path matches the given path.
|
public ServletContextURLContainer(javax.servlet.ServletContext servletContext)
public java.net.URL getResource(java.lang.String name)
URLContainer
The name is a slash (/
) separated path that identifies the
resource.
getResource
in interface URLContainer
name
- the resource namenull
if
the resource is not found or if the invoker does not have
adequate privileges to get the resourcepublic java.util.Set<java.lang.String> getResources(java.lang.String path)
URLContainer
Paths indicating sub-directory paths end with a slash (/
). A
path can be passed to the URLContainer.getResource(String)
method to return a
resource URL.
getResources
in interface URLContainer
path
- the resource path