Class FileSystemResourceStream

    • Constructor Detail

      • FileSystemResourceStream

        public FileSystemResourceStream​(java.nio.file.Path path)
        Constructor.
        Parameters:
        path - Path containing resource
      • FileSystemResourceStream

        public FileSystemResourceStream​(java.io.File file)
        Constructor.
        Parameters:
        file - File containing resource
      • FileSystemResourceStream

        public FileSystemResourceStream​(File file)
        Constructor.
        Parameters:
        file - File containing resource
    • Method Detail

      • close

        public void close()
                   throws java.io.IOException
        Description copied from interface: IResourceStream
        Closes the resource. Normally, this includes closing any underlying input stream returned by getInputStream().
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface IResourceStream
        Throws:
        java.io.IOException
      • getContentType

        public java.lang.String getContentType()
        Description copied from interface: IResourceStream
        Gets the mime type of this resource
        Specified by:
        getContentType in interface IResourceStream
        Overrides:
        getContentType in class AbstractResourceStream
        Returns:
        The mime type of this resource, such as "image/jpeg" or "text/html". Return null to let ResourceStreamRequestHandler handle the Content-Type automatically
      • getPath

        public final java.nio.file.Path getPath()
        Returns:
        The path this resource resides in, if any.
      • locationAsString

        public java.lang.String locationAsString()
        Specified by:
        locationAsString in interface IFixedLocationResourceStream
        Returns:
        The fixed location as a string, e.g. the file name or the URL. Return null to avoid caching the markup.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object