Class AbstractResourceLoader

java.lang.Object
fr.paris.lutece.plugins.resource.loader.AbstractResourceLoader
All Implemented Interfaces:
ResourceLoader
Direct Known Subclasses:
FileResourceLoader, JarResourceLoader, ServletContextResourceLoader, ThreadContextClasspathResourceLoader, URLResourceLoader

public abstract class AbstractResourceLoader extends Object implements ResourceLoader
Version:
$Id$
Author:
Trygve Laugstøl
  • Constructor Details

    • AbstractResourceLoader

      public AbstractResourceLoader()
  • Method Details

    • addSearchPath

      public void addSearchPath(String path)
      Specified by:
      addSearchPath in interface ResourceLoader
    • getResourceURL

      public Set<URL> getResourceURL(String path) throws ResourceNotFoundException
      Description copied from interface: ResourceLoader
      Retrieves the resource paths as a Set from a given directory. This method reads the files in the specified directory, converts their paths to URLs, and returns them in a Set. If no resources are found, a ResourceNotFoundException will be thrown.
      Specified by:
      getResourceURL in interface ResourceLoader
      Parameters:
      path - The base path in the file system, which can be either relative or absolute. This path is used to locate the directory containing the resources. The path must start with a "/".
      Returns:
      A Set containing the URLs of the resources found in the directory.
      Throws:
      ResourceNotFoundException - If no resources are found or if an error occurs while reading the directory or converting paths to URLs.