Class FileCacheEntry
- java.lang.Object
-
- org.glassfish.grizzly.http.server.filecache.FileCacheEntry
-
- All Implemented Interfaces:
java.lang.Runnable
public final class FileCacheEntry extends java.lang.Object implements java.lang.RunnableThe entry value in the file cache map.- Author:
- Alexey Stashok
-
-
Field Summary
Fields Modifier and Type Field Description ContentTypecontentTypejava.lang.Stringdatejava.lang.StringEtagjava.lang.StringhostFileCacheKeykeylonglastModifiedjava.lang.StringlastModifiedHeaderjava.lang.StringrequestURIjava.lang.StringserverlongtimeoutMillisFileCache.CacheTypetypejava.lang.StringxPoweredBy
-
Constructor Summary
Constructors Constructor Description FileCacheEntry(FileCache fileCache)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanServeCompressed(HttpRequestPacket request)Returns true if this entry could be served compressed as response to this (passed) specificHttpRequestPacket.protected voidfinalize()java.nio.ByteBuffergetByteBuffer(boolean isCompressed)Returns the entry'sByteBufferrepresentation.java.io.FilegetFile(boolean isCompressed)Returns the entry'sFilereference.longgetFileSize(boolean isCompressed)Returns the entry file size.voidrun()java.lang.StringtoString()
-
-
-
Field Detail
-
key
public FileCacheKey key
-
host
public java.lang.String host
-
requestURI
public java.lang.String requestURI
-
lastModified
public long lastModified
-
contentType
public ContentType contentType
-
xPoweredBy
public java.lang.String xPoweredBy
-
type
public FileCache.CacheType type
-
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) specificHttpRequestPacket. 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'sFilereference.- Parameters:
isCompressed- if true the compressedFilereference will be returned, otherwise uncompressedFilereference will be returned as the result.- Returns:
- the entry's
Filereference
-
getByteBuffer
public java.nio.ByteBuffer getByteBuffer(boolean isCompressed)
Returns the entry'sByteBufferrepresentation.- Parameters:
isCompressed- if true the compressedByteBufferwill be returned, otherwise uncompressedByteBufferwill be returned as the result.- Returns:
- the entry's
ByteBufferreference
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
finalize
protected void finalize() throws java.lang.Throwable- Overrides:
finalizein classjava.lang.Object- Throws:
java.lang.Throwable
-
-