Class FileCacheEntry

java.lang.Object
org.glassfish.grizzly.http.server.filecache.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 Details

    • key

      public FileCacheKey key
    • host

      public String host
    • requestURI

      public String requestURI
    • lastModified

      public long lastModified
    • contentType

      public ContentType contentType
    • xPoweredBy

      public String xPoweredBy
    • type

      public FileCache.CacheType type
    • date

      public String date
    • Etag

      public String Etag
    • lastModifiedHeader

      public String lastModifiedHeader
    • server

      public String server
    • timeoutMillis

      public volatile long timeoutMillis
  • Constructor Details

    • FileCacheEntry

      public FileCacheEntry(FileCache fileCache)
  • Method Details

    • 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 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
    • toString

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

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