Class MultipartBodyPublisher

  • All Implemented Interfaces:
    java.net.http.HttpRequest.BodyPublisher, java.util.concurrent.Flow.Publisher<java.nio.ByteBuffer>

    final class MultipartBodyPublisher
    extends java.lang.Object
    implements java.net.http.HttpRequest.BodyPublisher
    A BodyPublisher implementing the multipart request type.
    See Also:
    RFC 2046 Multipart Media Type
    • Field Detail

      • parts

        private final java.util.List<Part> parts
      • boundary

        private final java.lang.String boundary
      • contentLength

        private long contentLength
    • Constructor Detail

      • MultipartBodyPublisher

        private MultipartBodyPublisher​(java.util.List<Part> parts,
                                       ProgressMonitor monitor)
    • Method Detail

      • boundary

        java.lang.String boundary()
      • parts

        java.util.List<Part> parts()
      • contentLength

        public long contentLength()
        Specified by:
        contentLength in interface java.net.http.HttpRequest.BodyPublisher
      • subscribe

        public void subscribe​(java.util.concurrent.Flow.Subscriber<? super java.nio.ByteBuffer> subscriber)
        Specified by:
        subscribe in interface java.util.concurrent.Flow.Publisher<java.nio.ByteBuffer>
      • computeLength

        private long computeLength()
      • appendPartHeaders

        static void appendPartHeaders​(java.lang.StringBuilder target,
                                      Part part)
      • appendHeader

        private static void appendHeader​(java.lang.StringBuilder target,
                                         java.lang.String name,
                                         java.lang.String value)