Package com.liferay.portal.kernel.url
Class ServletContextURLContainer
Object
com.liferay.portal.kernel.url.ServletContextURLContainer
- All Implemented Interfaces:
URLContainer
- Author:
- Raymond Augé
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetResource(String name) Returns the resource with the given name.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.
-
Constructor Details
-
ServletContextURLContainer
public ServletContextURLContainer(javax.servlet.ServletContext servletContext)
-
-
Method Details
-
getResource
Description copied from interface:URLContainerReturns the resource with the given name. A resource is data that can be accessed in a way that is independent of the location or storage.The name is a slash (
/) separated path that identifies the resource.- Specified by:
getResourcein interfaceURLContainer- Parameters:
name- the resource name- Returns:
- the URL used for reading the resource, or
nullif the resource is not found or if the invoker does not have adequate privileges to get the resource
-
getResources
Description copied from interface:URLContainerReturns the directory-like listing of all the paths to resources within the container whose longest sub-path matches the given path. Resources that the invoker does not have access to are not included. If no resources are found, an empty set is returned.Paths indicating sub-directory paths end with a slash (
/). A path can be passed to theURLContainer.getResource(String)method to return a resource URL.- Specified by:
getResourcesin interfaceURLContainer- Parameters:
path- the resource path- Returns:
- the paths representing individual resources in the container
-