Class ServletContextURLContainer

Object
com.liferay.portal.kernel.url.ServletContextURLContainer
All Implemented Interfaces:
URLContainer

public class ServletContextURLContainer extends Object implements URLContainer
Author:
Raymond Augé
  • Constructor Details

    • ServletContextURLContainer

      public ServletContextURLContainer(javax.servlet.ServletContext servletContext)
  • Method Details

    • 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