Class HttpRequestMultiPart

    • Field Detail

      • parameters

        private java.util.List<BodyPart> parameters
      • charSet

        private java.nio.charset.Charset charSet
      • forceMulti

        private boolean forceMulti
    • Constructor Detail

      • HttpRequestMultiPart

        HttpRequestMultiPart​(HttpRequestBody httpRequest)
    • Method Detail

      • field

        public MultipartBody field​(java.lang.String name,
                                   java.lang.String value)
        Description copied from interface: MultipartBody
        add a simple field with a name and value
        Specified by:
        field in interface MultipartBody
        Parameters:
        name - : the Name of the form field
        value - : The string value for the field
        Returns:
        The same MultipartBody
      • field

        public MultipartBody field​(java.lang.String name,
                                   java.lang.String value,
                                   java.lang.String contentType)
        Description copied from interface: MultipartBody
        add a simple field with a name and value
        Specified by:
        field in interface MultipartBody
        Parameters:
        name - : the Name of the form field
        value - : The string value for the field
        contentType - : the content type of the value
        Returns:
        The same MultipartBody
      • field

        public MultipartBody field​(java.lang.String name,
                                   java.util.Collection<?> collection)
        Description copied from interface: MultipartBody
        add a simple field with a name and value
        Specified by:
        field in interface MultipartBody
        Parameters:
        name - : the Name of the form field
        collection - : A collection of values for the same name.
        Returns:
        The same MultipartBody
      • field

        public MultipartBody field​(java.lang.String name,
                                   java.io.InputStream value,
                                   ContentType contentType)
        Description copied from interface: MultipartBody
        add a simple field with a name and value
        Specified by:
        field in interface MultipartBody
        Parameters:
        name - : the Name of the form field
        value - : A input stream
        contentType - : the content mime-type of the file
        Returns:
        The same MultipartBody
      • field

        public MultipartBody field​(java.lang.String name,
                                   java.io.File file)
        Description copied from interface: MultipartBody
        add a simple field with a name and value
        Specified by:
        field in interface MultipartBody
        Parameters:
        name - : the Name of the form field
        file - : A File object.
        Returns:
        The same MultipartBody
      • field

        public MultipartBody field​(java.lang.String name,
                                   java.io.File file,
                                   java.lang.String contentType)
        Description copied from interface: MultipartBody
        add a simple field with a name and value
        Specified by:
        field in interface MultipartBody
        Parameters:
        name - : the Name of the form field
        file - : A File object.
        contentType - : the content mime-type of the file
        Returns:
        The same MultipartBody
      • field

        public MultipartBody field​(java.lang.String name,
                                   java.io.InputStream stream,
                                   ContentType contentType,
                                   java.lang.String fileName)
        Description copied from interface: MultipartBody
        add a simple field with a name and value
        Specified by:
        field in interface MultipartBody
        Parameters:
        name - : the Name of the form field
        stream - : A input stream
        contentType - : the content mime-type of the file
        fileName - : the name of the file which will be included in the file part header
        Returns:
        The same MultipartBody
      • field

        public MultipartBody field​(java.lang.String name,
                                   java.io.InputStream stream,
                                   java.lang.String fileName)
        Description copied from interface: MultipartBody
        add a simple field with a name and value
        Specified by:
        field in interface MultipartBody
        Parameters:
        name - : the Name of the form field
        stream - : The raw bytes for the file
        fileName - : the name of the file which will be included in the file part header
        Returns:
        The same MultipartBody
      • field

        public MultipartBody field​(java.lang.String name,
                                   byte[] bytes,
                                   ContentType contentType,
                                   java.lang.String fileName)
        Description copied from interface: MultipartBody
        add a simple field with a name and value
        Specified by:
        field in interface MultipartBody
        Parameters:
        name - : the Name of the form field
        bytes - : The raw bytes for the file
        contentType - : the content mime-type of the file
        fileName - : the name of the file which will be included in the file part header
        Returns:
        The same MultipartBody
      • field

        public MultipartBody field​(java.lang.String name,
                                   byte[] bytes,
                                   java.lang.String fileName)
        Description copied from interface: MultipartBody
        add a simple field with a name and value
        Specified by:
        field in interface MultipartBody
        Parameters:
        name - : the Name of the form field
        bytes - : The raw bytes for the file
        fileName - : the name of the file which will be included in the file part header
        Returns:
        The same MultipartBody
      • charset

        public MultipartBody charset​(java.nio.charset.Charset charset)
        Description copied from interface: MultipartBody
        Set the encoding of the request body
        Specified by:
        charset in interface MultipartBody
        Parameters:
        charset - the character set encoding of the body
        Returns:
        The same MultipartBody
      • contentType

        public MultipartBody contentType​(java.lang.String mimeType)
        Description copied from interface: MultipartBody
        Set the mime-type of the request body
        Specified by:
        contentType in interface MultipartBody
        Parameters:
        mimeType - the mime type of the body
        Returns:
        The same MultipartBody
      • uploadMonitor

        public MultipartBody uploadMonitor​(ProgressMonitor uploadMonitor)
        Description copied from interface: MultipartBody
        Set a file Progress upload monitor suitable for drawing progress bars and whatnot.
        Specified by:
        uploadMonitor in interface MultipartBody
        Parameters:
        uploadMonitor - a monitor
        Returns:
        The same MultipartBody
      • getCharset

        public java.nio.charset.Charset getCharset()
        Specified by:
        getCharset in interface Body
      • fields

        public MultipartBody fields​(java.util.Map<java.lang.String,​java.lang.Object> fields)
      • field

        public MultipartBody field​(java.lang.String name,
                                   java.lang.Object value,
                                   java.lang.String contentType)
      • addPart

        private void addPart​(java.lang.String name,
                             java.lang.Object value,
                             java.lang.String contentType)
      • addPart

        private void addPart​(BodyPart value)
      • isMultiPart

        public boolean isMultiPart()
        Specified by:
        isMultiPart in interface Body
      • isEntityBody

        public boolean isEntityBody()
        Specified by:
        isEntityBody in interface Body
      • multiParts

        public java.util.Collection<BodyPart> multiParts()
        Specified by:
        multiParts in interface Body
      • forceMultiPart

        MultipartBody forceMultiPart​(boolean value)