Class FileResourceStream

    • Constructor Detail

      • FileResourceStream

        public FileResourceStream​(File file)
        Constructor.
        Parameters:
        file - File containing resource
      • FileResourceStream

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

      • close

        public void close()
                   throws java.io.IOException
        Closes this resource.
        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
      • getFile

        public File getFile()
        Returns:
        The file this resource resides in, if any.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • 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.