Class FileResource

All Implemented Interfaces:
Resource, Comparable<Resource>

public class FileResource extends DefaultResource
A resource accessible by a file. The file may or may not have the same URI as the resource.
Author:
Garret Wilson
  • Constructor Details

    • FileResource

      public FileResource(File file)
      Constructs a resource with a file. The reference URI will be set to the reference URI of the file.
      Parameters:
      file - The file this resource represents.
      Throws:
      NullPointerException - if the given file or reference URI is null.
    • FileResource

      public FileResource(File file, URI referenceURI)
      Constructs a resource with a file and a reference URI.
      Parameters:
      file - The file this resource represents.
      referenceURI - The reference URI for the new resource.
      Throws:
      NullPointerException - if the given file is null.
  • Method Details

    • getFile

      public File getFile()
      Returns:
      The file this resource represents.
    • getChildResources

      public List<FileResource> getChildResources()
      Retrieves an list of child resources of this resource.
      Returns:
      A list of child resources.