Liferay 7.0-ce-b4

com.liferay.portal.kernel.url
Class ServletContextURLContainer

java.lang.Object
  extended by com.liferay.portal.kernel.url.ServletContextURLContainer
All Implemented Interfaces:
URLContainer

public class ServletContextURLContainer
extends Object
implements URLContainer


Constructor Summary
ServletContextURLContainer(javax.servlet.ServletContext servletContext)
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServletContextURLContainer

public ServletContextURLContainer(javax.servlet.ServletContext servletContext)
Method Detail

getResource

public URL getResource(String name)
Description copied from interface: URLContainer
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.

Specified by:
getResource in interface URLContainer
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

public Set<String> getResources(String path)
Description copied from interface: URLContainer
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 the URLContainer.getResource(String) method to return a resource URL.

Specified by:
getResources in interface URLContainer
Parameters:
path - the resource path
Returns:
the paths representing individual resources in the container

Liferay 7.0-ce-b4