Class FileCacheEntry

  • All Implemented Interfaces:
    Runnable

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

      • requestURI

        public String requestURI
      • lastModified

        public long lastModified
      • contentType

        public org.glassfish.grizzly.http.util.ContentType contentType
      • xPoweredBy

        public String xPoweredBy
      • lastModifiedHeader

        public String lastModifiedHeader
      • server

        public String server
      • timeoutMillis

        public volatile long timeoutMillis
    • Constructor Detail

      • FileCacheEntry

        public FileCacheEntry​(FileCache fileCache)
    • Method Detail

      • canServeCompressed

        public boolean canServeCompressed​(org.glassfish.grizzly.http.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 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 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 Runnable