Class FileResource

  • All Implemented Interfaces:
    Resource, java.lang.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 Detail

      • FileResource

        public FileResource​(java.io.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:
        java.lang.NullPointerException - if the given file or reference URI is null.
      • FileResource

        public FileResource​(java.io.File file,
                            java.net.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:
        java.lang.NullPointerException - if the given file is null.
    • Method Detail

      • getFile

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

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