Class DirectoryResource

java.lang.Object
cloud.piranha.resource.impl.DirectoryResource
All Implemented Interfaces:
Resource

public class DirectoryResource extends Object implements Resource
The default DirectoryResource.
Author:
Manfred Riem ([email protected])
  • Constructor Details

    • DirectoryResource

      public DirectoryResource()
      Constructor.
    • DirectoryResource

      public DirectoryResource(String rootDirectory)
      Constructor.
      Parameters:
      rootDirectory - the root directory.
    • DirectoryResource

      public DirectoryResource(File rootDirectory)
      Constructor.
      Parameters:
      rootDirectory - the root directory.
  • Method Details

    • getAllLocations

      public Stream<String> getAllLocations()
      Description copied from interface: Resource
      Returns all the locations for this resource.
      Specified by:
      getAllLocations in interface Resource
      Returns:
      all the locations for this resource
    • getName

      public String getName()
      Description copied from interface: Resource
      Get the name of this resource
      Specified by:
      getName in interface Resource
      Returns:
      the name
    • getResource

      public URL getResource(String location)
      Returns the resource.
      Specified by:
      getResource in interface Resource
      Parameters:
      location - the location.
      Returns:
      the resource
    • getResourceAsStream

      public InputStream getResourceAsStream(String location)
      Description copied from interface: Resource
      Get the resource as a stream.
      Specified by:
      getResourceAsStream in interface Resource
      Parameters:
      location - the resource location.
      Returns:
      the input stream, or null if not found.
      See Also:
    • getRootDirectory

      public File getRootDirectory()
      Returns the root directory.
      Returns:
      the root directory
    • setRootDirectory

      public void setRootDirectory(File rootDirectory)
      Set the root directory.
      Parameters:
      rootDirectory - the root directory.
    • toString

      public String toString()
      Overrides:
      toString in class Object