Class MultiPart.ContentSourcePart

java.lang.Object
org.eclipse.jetty.http.MultiPart.Part
org.eclipse.jetty.http.MultiPart.ContentSourcePart
All Implemented Interfaces:
Closeable, AutoCloseable, Content.Source.Factory
Enclosing class:
MultiPart

public static class MultiPart.ContentSourcePart extends MultiPart.Part

A MultiPart.Part whose content is a Content.Source.

  • Constructor Details

  • Method Details

    • getLength

      public long getLength()
      Overrides:
      getLength in class MultiPart.Part
    • newContentSource

      public Content.Source newContentSource(ByteBufferPool.Sized bufferPool, long offset, long length)
      Description copied from class: MultiPart.Part
      Creates a new Content.Source.

      Returns the content of this part as a new Content.Source

      If the content is reproducible, invoking this method multiple times will return a different independent instance for every invocation.

      If the content is not reproducible, subsequent calls to this method will return null.

      The content type and content encoding are specified in this part's headers.

      The content encoding may be specified by the part named _charset_, as specified in RFC 7578, section 4.6.

      Specified by:
      newContentSource in interface Content.Source.Factory
      Overrides:
      newContentSource in class MultiPart.Part
      Parameters:
      bufferPool - the ByteBufferPool.Sized to get buffers from. null means allocate new buffers as needed.
      offset - the offset byte of the content to start from. Must be greater than or equal to 0 and less than the content length (if known).
      length - the length of the content to make available, -1 for the full length. If the size of the content is known, the length may be truncated to the content size minus the offset.
      Returns:
      a Content.Source.
      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class Object