Class ModifiedMultipartEntity

  • All Implemented Interfaces:
    org.apache.http.HttpEntity

    public class ModifiedMultipartEntity
    extends java.lang.Object
    implements org.apache.http.HttpEntity
    Multipart/form coded HTTP entity consisting of multiple body parts.
    Since:
    4.0
    • Constructor Detail

      • ModifiedMultipartEntity

        public ModifiedMultipartEntity​(org.apache.http.entity.mime.HttpMultipartMode mode,
                                       java.lang.String boundary,
                                       java.nio.charset.Charset charset)
        Creates an instance using the specified parameters
        Parameters:
        mode - the mode to use, may be null, in which case HttpMultipartMode.STRICT is used
        boundary - the boundary string, may be null, in which case generateBoundary() is invoked to create the string
        charset - the character set to use, may be null, in which case MIME.DEFAULT_CHARSET - i.e. US-ASCII - is used.
      • ModifiedMultipartEntity

        public ModifiedMultipartEntity​(org.apache.http.entity.mime.HttpMultipartMode mode)
        Creates an instance using the specified HttpMultipartMode mode. Boundary and charset are set to null.
        Parameters:
        mode - the desired mode
      • ModifiedMultipartEntity

        public ModifiedMultipartEntity()
        Creates an instance using mode HttpMultipartMode.STRICT
    • Method Detail

      • generateContentType

        protected java.lang.String generateContentType​(java.lang.String boundary,
                                                       java.nio.charset.Charset charset)
      • generateBoundary

        protected java.lang.String generateBoundary()
      • addPart

        public void addPart​(org.apache.http.entity.mime.FormBodyPart bodyPart)
      • addPart

        public void addPart​(java.lang.String name,
                            org.apache.http.entity.mime.content.ContentBody contentBody)
      • isRepeatable

        public boolean isRepeatable()
        Specified by:
        isRepeatable in interface org.apache.http.HttpEntity
      • isChunked

        public boolean isChunked()
        Specified by:
        isChunked in interface org.apache.http.HttpEntity
      • isStreaming

        public boolean isStreaming()
        Specified by:
        isStreaming in interface org.apache.http.HttpEntity
      • getContentLength

        public long getContentLength()
        Specified by:
        getContentLength in interface org.apache.http.HttpEntity
      • getContentType

        public org.apache.http.Header getContentType()
        Specified by:
        getContentType in interface org.apache.http.HttpEntity
      • getContentEncoding

        public org.apache.http.Header getContentEncoding()
        Specified by:
        getContentEncoding in interface org.apache.http.HttpEntity
      • consumeContent

        @Deprecated
        public void consumeContent()
                            throws java.io.IOException,
                                   java.lang.UnsupportedOperationException
        Deprecated.
        Specified by:
        consumeContent in interface org.apache.http.HttpEntity
        Throws:
        java.io.IOException
        java.lang.UnsupportedOperationException
      • getContent

        public java.io.InputStream getContent()
                                       throws java.io.IOException,
                                              java.lang.UnsupportedOperationException
        Specified by:
        getContent in interface org.apache.http.HttpEntity
        Throws:
        java.io.IOException
        java.lang.UnsupportedOperationException
      • writeTo

        public void writeTo​(java.io.OutputStream outstream)
                     throws java.io.IOException
        Specified by:
        writeTo in interface org.apache.http.HttpEntity
        Throws:
        java.io.IOException