Class HttpRFC7578Multipart
java.lang.Object
org.apache.hc.client5.http.entity.mime.AbstractMultipartFormat
org.apache.hc.client5.http.entity.mime.HttpRFC7578Multipart
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List
<MultipartPart> private static final HttpRFC7578Multipart.PercentCodec
private static final int
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
ConstructorsConstructorDescriptionHttpRFC7578Multipart
(Charset charset, String boundary, List<MultipartPart> parts) Constructs a new instance ofHttpRFC7578Multipart
with the given charset, boundary, and parts.HttpRFC7578Multipart
(Charset charset, String boundary, List<MultipartPart> parts, String preamble, String epilogue) Constructs a new instance ofHttpRFC7578Multipart
with the given charset, boundary, parts, preamble, and epilogue. -
Method Summary
Modifier and TypeMethodDescription(package private) static int
digit16
(byte b) Returns the numeric value of the characterb
in radix 16.protected void
formatMultipartHeader
(MultipartPart part, OutputStream out) Write the multipart header fields; depends on the style.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 Details
-
PERCENT_CODEC
-
parts
-
RADIX
private static final int RADIXRadix used in encoding and decoding.- See Also:
-
-
Constructor Details
-
HttpRFC7578Multipart
public HttpRFC7578Multipart(Charset charset, String boundary, List<MultipartPart> parts, String preamble, 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
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 Details
-
getParts
- Specified by:
getParts
in classAbstractMultipartFormat
-
formatMultipartHeader
Description copied from class:AbstractMultipartFormat
Write the multipart header fields; depends on the style.- Specified by:
formatMultipartHeader
in classAbstractMultipartFormat
- Throws:
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:
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.
-