Package com.liferay.portal.kernel.url
Interface URLContainer
- All Known Implementing Classes:
ServletContextURLContainer
public interface URLContainer
- Author:
- Raymond Augé
-
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.
-
Method Details
-
getResource
Returns 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.- Parameters:
name
- the resource name- Returns:
- the URL used for reading the resource, or
null
if the resource is not found or if the invoker does not have adequate privileges to get the resource
-
getResources
Returns 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 thegetResource(String)
method to return a resource URL.- Parameters:
path
- the resource path- Returns:
- the paths representing individual resources in the container
-