Top Inners Fields Constructors Methods
org.apache.hc.client5.http.entity.mime

pack-priv Class HttpRFC7578Multipart

extends AbstractMultipartFormat
Class Inheritance
Imports
java.io.ByteArrayOutputStream, .IOException, .OutputStream, java.nio.charset.Charset, .CharsetEncoder, .StandardCharsets, java.util.BitSet, .List, org.apache.hc.core5.http.NameValuePair, org.apache.hc.core5.util.ByteArrayBuffer

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
private final List<MultipartPart>
private static final HttpRFC7578Multipart.PercentCodec
private static final int
RADIX

Radix used in encoding and decoding.

Inherited from org.apache.hc.client5.http.entity.mime.AbstractMultipartFormat:
boundarycharsetCR_LFFIELD_SEPTWO_HYPHENS

Constructor Summary

AccessConstructor and Description
public
HttpRFC7578Multipart(final Charset
the charset to use.
charset
,
final String
the boundary string to use.
boundary
,
final List<MultipartPart>
the list of parts to include in the multipart message.
parts
,
final String
the optional preamble string to include before the first part. May be null.
preamble
,
final String
the optional epilogue string to include after the last part. May be null.
epilogue
)

Constructs a new instance of HttpRFC7578Multipart with the given charset, boundary, parts, preamble, and epilogue.

public
HttpRFC7578Multipart(final Charset
the charset to use.
charset
,
final String
the boundary string to use.
boundary
,
final List<MultipartPart>
the list of parts to include in the multipart message.
parts
)

Constructs a new instance of HttpRFC7578Multipart with the given charset, boundary, and parts.

Method Summary

Modifier and TypeMethod and Description
pack-priv static int

Returns:

The numeric value represented by the character in radix 16.
digit16
(final byte
The byte to be converted.
b
)

Returns the numeric value of the character b in radix 16.

protected void
formatMultipartHeader(final MultipartPart part, final OutputStream out)

Implements abstract org.apache.hc.client5.http.entity.mime.AbstractMultipartFormat.formatMultipartHeader.

Write the multipart header fields; depends on the style.
public List<MultipartPart>
pack-priv static char

Returns:

the upper case hex digit of the lower 4 bits of the int.
hexDigit
(final int
the input int
b
)

Returns the upper case hex digit of the lower 4 bits of the int.

Inherited from org.apache.hc.client5.http.entity.mime.AbstractMultipartFormat:
doWriteToencodegetTotalLengthisLineBreakstripLineBreakswriteByteswriteByteswriteByteswriteFieldwriteFieldwriteTo

Field Detail

partsback to summary
private final List<MultipartPart> parts
PERCENT_CODECback to summary
private static final HttpRFC7578Multipart.PercentCodec PERCENT_CODEC
RADIXback to summary
private static final int RADIX

Radix used in encoding and decoding.

Constructor Detail

HttpRFC7578Multipartback to summary
public HttpRFC7578Multipart(final Charset charset, final String boundary, final List<MultipartPart> parts, final String preamble, final String epilogue)

Constructs a new instance of HttpRFC7578Multipart with the given charset, boundary, parts, preamble, and epilogue.

Parameters
charset:Charset

the charset to use.

boundary:String

the boundary string to use.

parts:List<MultipartPart>

the list of parts to include in the multipart message.

preamble:String

the optional preamble string to include before the first part. May be null.

epilogue:String

the optional epilogue string to include after the last part. May be null.

HttpRFC7578Multipartback to summary
public HttpRFC7578Multipart(final Charset charset, final String boundary, final List<MultipartPart> parts)

Constructs a new instance of HttpRFC7578Multipart with the given charset, boundary, and parts.

Parameters
charset:Charset

the charset to use.

boundary:String

the boundary string to use.

parts:List<MultipartPart>

the list of parts to include in the multipart message.

Method Detail

digit16back to summary
pack-priv static int digit16(final byte b)

Returns the numeric value of the character b in radix 16.

Parameters
b:byte

The byte to be converted.

Returns:int

The numeric value represented by the character in radix 16.

Exceptions
IllegalArgumentException:
Thrown when the byte is not valid per Character#digit(char, int)
formatMultipartHeaderback to summary
protected void formatMultipartHeader(final MultipartPart part, final OutputStream out) throws IOException

Implements abstract org.apache.hc.client5.http.entity.mime.AbstractMultipartFormat.formatMultipartHeader.

Doc from org.apache.hc.client5.http.entity.mime.AbstractMultipartFormat.formatMultipartHeader.

Write the multipart header fields; depends on the style.

Annotations
@Override
getPartsback to summary
public List<MultipartPart> getParts()

Implements abstract org.apache.hc.client5.http.entity.mime.AbstractMultipartFormat.getParts.

Annotations
@Override
hexDigitback to summary
pack-priv static char hexDigit(final int b)

Returns the upper case hex digit of the lower 4 bits of the int.

Parameters
b:int

the input int

Returns:char

the upper case hex digit of the lower 4 bits of the int.

org.apache.hc.client5.http.entity.mime back to summary

pack-priv Class HttpRFC7578Multipart.PercentCodec

extends Object
Class Inheritance
  • java.lang.Object
  • org.apache.hc.client5.http.entity.mime.HttpRFC7578Multipart.PercentCodec

Field Summary

Modifier and TypeField and Description
private static final BitSet
private static final byte

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public byte[]
decode(final byte[] bytes)

public byte[]
encode(final byte[] bytes)

Percent-Encoding implementation based on RFC 3986

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ALWAYSENCODECHARSback to summary
private static final BitSet ALWAYSENCODECHARS
ESCAPE_CHARback to summary
private static final byte ESCAPE_CHAR

Constructor Detail

PercentCodecback to summary
pack-priv PercentCodec()

Method Detail

decodeback to summary
public byte[] decode(final byte[] bytes)
encodeback to summary
public byte[] encode(final byte[] bytes)

Percent-Encoding implementation based on RFC 3986