Class PreCompressedHttpContent
java.lang.Object
org.eclipse.jetty.http.content.PreCompressedHttpContent
- All Implemented Interfaces:
HttpContent
-
Nested Class Summary
Nested classes/interfaces inherited from interface HttpContent
HttpContent.Factory, HttpContent.Wrapper -
Constructor Summary
ConstructorsConstructorDescriptionPreCompressedHttpContent(HttpContent content, HttpContent precompressedContent, CompressedContentFormat format) -
Method Summary
Modifier and TypeMethodDescriptionGet the character encoding of this HTTP content.Get theHttpHeader.CONTENT_ENCODINGof this HTTP content.Get theHttpHeader.CONTENT_LENGTHof this HTTP content.longGet the content length of this resource.Get theHttpHeader.CONTENT_TYPEof this HTTP content.getETag()Get theHttpHeader.ETAGof this HTTP content.Get theHttpHeader.LAST_MODIFIEDof 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.Get theResourcebacking this HTTP content.toString()voidwriteTo(Content.Sink sink, long offset, long length, Callback callback) Asynchronously write a subset of this HTTP content to aContent.Sink.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface HttpContent
getContentEncodingValue, getContentTypeValue, getETagValue
-
Constructor Details
-
PreCompressedHttpContent
public PreCompressedHttpContent(HttpContent content, HttpContent precompressedContent, CompressedContentFormat format)
-
-
Method Details
-
getResource
Description copied from interface:HttpContentGet theResourcebacking this HTTP content.- Specified by:
getResourcein interfaceHttpContent- Returns:
- the backing resource.
-
getETag
Description copied from interface:HttpContentGet theHttpHeader.ETAGof this HTTP content.- Specified by:
getETagin interfaceHttpContent- Returns:
- the ETag, or null if this content has no ETag.
-
getLastModifiedInstant
Description copied from interface:HttpContentGet the last modified instant of this resource. Always return the most up-to-date value.- Specified by:
getLastModifiedInstantin interfaceHttpContent- Returns:
- the last modified instant, or null if that instant of this content is not known.
- See Also:
-
getLastModified
Description copied from interface:HttpContentGet theHttpHeader.LAST_MODIFIEDof this HTTP content. The value of the returned field must always match the value returned byHttpContent.getLastModifiedInstant().- Specified by:
getLastModifiedin interfaceHttpContent- Returns:
- the last modified field, or null if the last modification time of this content is not known.
-
getContentType
Description copied from interface:HttpContentGet theHttpHeader.CONTENT_TYPEof this HTTP content.- Specified by:
getContentTypein interfaceHttpContent- Returns:
- the content type field, or null if the type of this content is not known.
-
getContentEncoding
Description copied from interface:HttpContentGet theHttpHeader.CONTENT_ENCODINGof this HTTP content.- Specified by:
getContentEncodingin interfaceHttpContent- Returns:
- the content encoding field, or null if the encoding of this content is not known.
-
getCharacterEncoding
Description copied from interface:HttpContentGet the character encoding of this HTTP content.- Specified by:
getCharacterEncodingin interfaceHttpContent- Returns:
- the character encoding, or null if the character encoding of this content is not known.
-
getMimeType
Description copied from interface:HttpContentGet the Mime type of this HTTP content.- Specified by:
getMimeTypein interfaceHttpContent- Returns:
- the mime type, or null if the mime type of this content is not known.
-
getContentLength
Description copied from interface:HttpContentGet theHttpHeader.CONTENT_LENGTHof this HTTP content. The value of the returned field must always match the value returned byHttpContent.getContentLengthValue().- Specified by:
getContentLengthin interfaceHttpContent- Returns:
- the content length field, or null if the length of this content is not known.
-
getContentLengthValue
public long getContentLengthValue()Description copied from interface:HttpContentGet the content length of this resource.- Specified by:
getContentLengthValuein interfaceHttpContent- Returns:
- the content length of this resource, or -1 if it is not known.
- See Also:
-
toString
-
writeTo
Description copied from interface:HttpContentAsynchronously 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:
writeToin interfaceHttpContent- 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. If the length is longer than the available content, the write is truncated to the available length.callback- the callback to notify when writing is done.
-
getPreCompressedContentFormats
Description copied from interface:HttpContentGet available pre-compressed formats for this content.- Specified by:
getPreCompressedContentFormatsin interfaceHttpContent- Returns:
- Set of available pre-compressed formats for this content, or null if this has not been checked.
-