Class BodyPartBuilder

java.lang.Object
com.linecorp.armeria.common.multipart.BodyPartBuilder

public final class BodyPartBuilder extends Object
A builder class for creating BodyPart instances.
  • Method Details

    • headers

      public BodyPartBuilder headers(HttpHeaders headers)
      Sets the specified headers for this part.
      Parameters:
      headers - headers
    • content

      public BodyPartBuilder content(org.reactivestreams.Publisher<? extends HttpData> publisher)
      Adds a new body part backed by the specified Publisher.
      Parameters:
      publisher - publisher for the part content
    • content

      public BodyPartBuilder content(CharSequence content)
      Adds the specified CharSequence as a UTF-8-encoded body part content.
    • content

      public BodyPartBuilder content(byte[] contents)
      Adds the specified bytes as a body part content.
    • content

      public BodyPartBuilder content(File file)
      Adds the specified File as a body part content. The default buffer size(8192) is used to create a buffer and the buffer is used to read data from the File.
    • content

      public BodyPartBuilder content(File file, int bufferSize)
      Adds the specified File as a body part content. The specified bufferSize is used to create a buffer and the buffer is used to read data from the File.
    • content

      public BodyPartBuilder content(Path path)
      Adds the specified Path as a body part content. The default buffer size(8192) is used to create a buffer and the buffer is used to read data from the Path.
    • content

      public BodyPartBuilder content(Path path, int bufferSize)
      Adds the specified Path as a body part content. The specified bufferSize is used to create a buffer and the buffer is used to read data from the Path.
    • content

      public BodyPartBuilder content(HttpData content)
      Adds the specified HttpData as a body part content.
    • build

      public BodyPart build()
      Returns a newly-created BodyPart.