Class CachingHttpContentFactory.CachedHttpContent
java.lang.Object
org.eclipse.jetty.http.content.HttpContent.Wrapper
org.eclipse.jetty.http.content.CachingHttpContentFactory.CachedHttpContent
- All Implemented Interfaces:
CachingHttpContentFactory.CachingHttpContent
,HttpContent
- Direct Known Subclasses:
ValidatingCachingHttpContentFactory.ValidatingCachedContent
- Enclosing class:
CachingHttpContentFactory
protected class CachingHttpContentFactory.CachedHttpContent
extends HttpContent.Wrapper
implements CachingHttpContentFactory.CachingHttpContent
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jetty.http.content.HttpContent
HttpContent.Factory, HttpContent.Wrapper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the character encoding of this HTTP content.Get theHttpHeader.CONTENT_LENGTH
of this HTTP content.long
Get the content length of this resource.getETag()
Get theHttpHeader.ETAG
of this HTTP content.getKey()
long
Get theHttpHeader.LAST_MODIFIED
of this HTTP content.Get the last modified instant of this resource.Get the Mime type of this HTTP content.Get available pre-compressed formats for this content.boolean
isValid()
void
release()
void
setLastAccessedNanos
(long nanosTime) void
writeTo
(Content.Sink sink, long offset, long length, Callback callback) Asynchronously write a subset of this HTTP content to aContent.Sink
.Methods inherited from class org.eclipse.jetty.http.content.HttpContent.Wrapper
getContentEncoding, getContentType, getResource, getWrapped, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.jetty.http.content.HttpContent
getContentEncoding, getContentEncodingValue, getContentType, getContentTypeValue, getETagValue, getResource
-
Constructor Details
-
CachedHttpContent
-
-
Method Details
-
getLastAccessedNanos
public long getLastAccessedNanos()- Specified by:
getLastAccessedNanos
in interfaceCachingHttpContentFactory.CachingHttpContent
-
setLastAccessedNanos
public void setLastAccessedNanos(long nanosTime) - Specified by:
setLastAccessedNanos
in interfaceCachingHttpContentFactory.CachingHttpContent
-
getKey
- Specified by:
getKey
in interfaceCachingHttpContentFactory.CachingHttpContent
-
writeTo
Description copied from interface:HttpContent
Asynchronously write a subset of this HTTP content to aContent.Sink
. Calling this method does not consume the content, so it can be used repeatedly.- Specified by:
writeTo
in interfaceHttpContent
- Overrides:
writeTo
in classHttpContent.Wrapper
- Parameters:
sink
- the sink to write to.offset
- the offset byte of the resource to start from.length
- the length of the resource's contents to copy, -1 for the full length.callback
- the callback to notify when writing is done.
-
release
public void release()- Specified by:
release
in interfaceCachingHttpContentFactory.CachingHttpContent
-
getPreCompressedContentFormats
Description copied from interface:HttpContent
Get available pre-compressed formats for this content.- Specified by:
getPreCompressedContentFormats
in interfaceHttpContent
- Overrides:
getPreCompressedContentFormats
in classHttpContent.Wrapper
- Returns:
- Set of available pre-compressed formats for this content, or null if this has not been checked.
-
getETag
Description copied from interface:HttpContent
Get theHttpHeader.ETAG
of this HTTP content.- Specified by:
getETag
in interfaceHttpContent
- Overrides:
getETag
in classHttpContent.Wrapper
- Returns:
- the ETag, or null if this content has no ETag.
-
getCharacterEncoding
Description copied from interface:HttpContent
Get the character encoding of this HTTP content.- Specified by:
getCharacterEncoding
in interfaceHttpContent
- Overrides:
getCharacterEncoding
in classHttpContent.Wrapper
- Returns:
- the character encoding, or null if the character encoding of this content is not known.
-
getMimeType
Description copied from interface:HttpContent
Get the Mime type of this HTTP content.- Specified by:
getMimeType
in interfaceHttpContent
- Overrides:
getMimeType
in classHttpContent.Wrapper
- Returns:
- the mime type, or null if the mime type of this content is not known.
-
getContentLength
Description copied from interface:HttpContent
Get theHttpHeader.CONTENT_LENGTH
of this HTTP content. The value of the returned field must always match the value returned byHttpContent.getContentLengthValue()
.- Specified by:
getContentLength
in interfaceHttpContent
- Overrides:
getContentLength
in classHttpContent.Wrapper
- Returns:
- the content length field, or null if the length of this content is not known.
-
getContentLengthValue
public long getContentLengthValue()Description copied from interface:HttpContent
Get the content length of this resource.- Specified by:
getContentLengthValue
in interfaceHttpContent
- Overrides:
getContentLengthValue
in classHttpContent.Wrapper
- Returns:
- the content length of this resource, or -1 if it is not known.
- See Also:
-
getLastModifiedInstant
Description copied from interface:HttpContent
Get the last modified instant of this resource.- Specified by:
getLastModifiedInstant
in interfaceHttpContent
- Overrides:
getLastModifiedInstant
in classHttpContent.Wrapper
- Returns:
- the last modified instant, or null if that instant of this content is not known.
- See Also:
-
getLastModified
Description copied from interface:HttpContent
Get theHttpHeader.LAST_MODIFIED
of this HTTP content. The value of the returned field must always match the value returned byHttpContent.getLastModifiedInstant()
.- Specified by:
getLastModified
in interfaceHttpContent
- Overrides:
getLastModified
in classHttpContent.Wrapper
- Returns:
- the last modified field, or null if the last modification time of this content is not known.
-
isValid
public boolean isValid()- Specified by:
isValid
in interfaceCachingHttpContentFactory.CachingHttpContent
-