Class FileCacheEntry

  • All Implemented Interfaces:
    java.lang.Runnable

    public final class FileCacheEntry
    extends java.lang.Object
    implements java.lang.Runnable
    The entry value in the file cache map.
    Author:
    Alexey Stashok
    • Field Detail

      • host

        public java.lang.String host
      • requestURI

        public java.lang.String requestURI
      • lastModified

        public long lastModified
      • xPoweredBy

        public java.lang.String xPoweredBy
      • date

        public java.lang.String date
      • Etag

        public java.lang.String Etag
      • lastModifiedHeader

        public java.lang.String lastModifiedHeader
      • server

        public java.lang.String server
      • timeoutMillis

        public volatile long timeoutMillis
    • Constructor Detail

      • FileCacheEntry

        public FileCacheEntry​(FileCache fileCache)
    • Method Detail

      • canServeCompressed

        public boolean canServeCompressed​(HttpRequestPacket request)
        Returns true if this entry could be served compressed as response to this (passed) specific HttpRequestPacket. Or false will be returned otherwise.
      • getFileSize

        public long getFileSize​(boolean isCompressed)
        Returns the entry file size.
        Parameters:
        isCompressed - if true the compressed file size will be returned, otherwise uncompressed file size will be returned as the result.
        Returns:
        the entry file size
      • getFile

        public java.io.File getFile​(boolean isCompressed)
        Returns the entry's File reference.
        Parameters:
        isCompressed - if true the compressed File reference will be returned, otherwise uncompressed File reference will be returned as the result.
        Returns:
        the entry's File reference
      • getByteBuffer

        public java.nio.ByteBuffer getByteBuffer​(boolean isCompressed)
        Returns the entry's ByteBuffer representation.
        Parameters:
        isCompressed - if true the compressed ByteBuffer will be returned, otherwise uncompressed ByteBuffer will be returned as the result.
        Returns:
        the entry's ByteBuffer reference
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
      • toString

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

        protected void finalize()
                         throws java.lang.Throwable
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable