Interface HttpContent

All Known Subinterfaces:
CachingHttpContentFactory.CachingHttpContent
All Known Implementing Classes:
CachingHttpContentFactory.CachedHttpContent, CachingHttpContentFactory.NotFoundHttpContent, HttpContent.Wrapper, PreCompressedHttpContent, ResourceHttpContent, ValidatingCachingHttpContentFactory.ValidatingCachedContent, ValidatingCachingHttpContentFactory.ValidatingNotFoundContent

public interface HttpContent
HttpContent interface.

This information represents all the information about a static resource that is needed to evaluate conditional headers and to serve the content if need be. It can be implemented either transiently (values and fields generated on demand) or persistently (values and fields pre-generated in anticipation of reuse in from a cache).

  • Method Details

    • getContentType

      HttpField getContentType()
    • getContentTypeValue

      String getContentTypeValue()
    • getCharacterEncoding

      String getCharacterEncoding()
    • getMimeType

      MimeTypes.Type getMimeType()
    • getContentEncoding

      HttpField getContentEncoding()
    • getContentEncodingValue

      String getContentEncodingValue()
    • getContentLength

      HttpField getContentLength()
    • getContentLengthValue

      long getContentLengthValue()
    • getLastModifiedInstant

      Instant getLastModifiedInstant()
    • getLastModified

      HttpField getLastModified()
    • getLastModifiedValue

      String getLastModifiedValue()
    • getETag

      HttpField getETag()
    • getETagValue

      String getETagValue()
    • getResource

      Resource getResource()
    • getByteBuffer

      ByteBuffer getByteBuffer()

      Get this HTTP content as a ByteBuffer if possible.

      Each invocation returns a new ByteBuffer instance that is read-only and contains valid data between the pos and the limit.

      Returns:
      a ByteBuffer instance or null.
    • getBytesOccupied

      default long getBytesOccupied()
    • getPreCompressedContentFormats

      Set<CompressedContentFormat> getPreCompressedContentFormats()
      Returns:
      Set of available pre-compressed formats for this content, or null if this has not been checked.
    • release

      void release()