Class HttpRFC7578Multipart
- java.lang.Object
-
- org.apache.hc.client5.http.entity.mime.AbstractMultipartFormat
-
- org.apache.hc.client5.http.entity.mime.HttpRFC7578Multipart
-
class HttpRFC7578Multipart extends AbstractMultipartFormat
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
HttpRFC7578Multipart.PercentCodec
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<MultipartPart>
parts
private static HttpRFC7578Multipart.PercentCodec
PERCENT_CODEC
private static int
RADIX
Radix used in encoding and decoding.-
Fields inherited from class org.apache.hc.client5.http.entity.mime.AbstractMultipartFormat
boundary, charset, CR_LF, FIELD_SEP, TWO_HYPHENS
-
-
Constructor Summary
Constructors Constructor Description HttpRFC7578Multipart(java.nio.charset.Charset charset, java.lang.String boundary, java.util.List<MultipartPart> parts)
Constructs a new instance ofHttpRFC7578Multipart
with the given charset, boundary, and parts.HttpRFC7578Multipart(java.nio.charset.Charset charset, java.lang.String boundary, java.util.List<MultipartPart> parts, java.lang.String preamble, java.lang.String epilogue)
Constructs a new instance ofHttpRFC7578Multipart
with the given charset, boundary, parts, preamble, and epilogue.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static int
digit16(byte b)
Returns the numeric value of the characterb
in radix 16.protected void
formatMultipartHeader(MultipartPart part, java.io.OutputStream out)
Write the multipart header fields; depends on the style.java.util.List<MultipartPart>
getParts()
(package private) static char
hexDigit(int b)
Returns the upper case hex digit of the lower 4 bits of the int.-
Methods inherited from class org.apache.hc.client5.http.entity.mime.AbstractMultipartFormat
doWriteTo, encode, getTotalLength, isLineBreak, stripLineBreaks, writeBytes, writeBytes, writeBytes, writeField, writeField, writeTo
-
-
-
-
Field Detail
-
PERCENT_CODEC
private static final HttpRFC7578Multipart.PercentCodec PERCENT_CODEC
-
parts
private final java.util.List<MultipartPart> parts
-
RADIX
private static final int RADIX
Radix used in encoding and decoding.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
HttpRFC7578Multipart
public HttpRFC7578Multipart(java.nio.charset.Charset charset, java.lang.String boundary, java.util.List<MultipartPart> parts, java.lang.String preamble, java.lang.String epilogue)
Constructs a new instance ofHttpRFC7578Multipart
with the given charset, boundary, parts, preamble, and epilogue.- Parameters:
charset
- the charset to use.boundary
- the boundary string to use.parts
- the list of parts to include in the multipart message.preamble
- the optional preamble string to include before the first part. May benull
.epilogue
- the optional epilogue string to include after the last part. May benull
.
-
HttpRFC7578Multipart
public HttpRFC7578Multipart(java.nio.charset.Charset charset, java.lang.String boundary, java.util.List<MultipartPart> parts)
Constructs a new instance ofHttpRFC7578Multipart
with the given charset, boundary, and parts.- Parameters:
charset
- the charset to use.boundary
- the boundary string to use.parts
- the list of parts to include in the multipart message.
-
-
Method Detail
-
getParts
public java.util.List<MultipartPart> getParts()
- Specified by:
getParts
in classAbstractMultipartFormat
-
formatMultipartHeader
protected void formatMultipartHeader(MultipartPart part, java.io.OutputStream out) throws java.io.IOException
Description copied from class:AbstractMultipartFormat
Write the multipart header fields; depends on the style.- Specified by:
formatMultipartHeader
in classAbstractMultipartFormat
- Throws:
java.io.IOException
-
digit16
static int digit16(byte b)
Returns the numeric value of the characterb
in radix 16.- Parameters:
b
- The byte to be converted.- Returns:
- The numeric value represented by the character in radix 16.
- Throws:
java.lang.IllegalArgumentException
- Thrown when the byte is not valid perCharacter.digit(char,int)
-
hexDigit
static char hexDigit(int b)
Returns the upper case hex digit of the lower 4 bits of the int.- Parameters:
b
- the input int- Returns:
- the upper case hex digit of the lower 4 bits of the int.
-
-