public class ServletContextURLContainer extends Object implements URLContainer
Constructor and Description |
---|
ServletContextURLContainer(javax.servlet.ServletContext servletContext) |
Modifier and Type | Method and Description |
---|---|
URL |
getResource(String name)
Returns the resource with the given name.
|
Set<String> |
getResources(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 URL getResource(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 Set<String> getResources(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