Package de.xima.fc.http.params
Class BinaryData
java.lang.Object
de.xima.fc.http.params.BinaryData
Binary data that can be added to a HTTP request.
- Since:
- 7.0.3
- Author:
- XIMA MEDIA GmbH
-
Constructor Summary
ConstructorsConstructorDescriptionBinaryData
(String name, byte[] data, String filename, String mimeType) Creates a new binary data item.BinaryData
(String name, byte[] data, String filename, String mimeType, Charset charset) Creates a new binary data item. -
Method Summary
-
Constructor Details
-
BinaryData
public BinaryData(@Nonnull String name, @Nonnull byte[] data, @Nonnull String filename, @Nonnull String mimeType) Creates a new binary data item. Uses the default charset.- Parameters:
name
- The name of the binary data item when sending the request.data
- The binary data to be sent with the request.filename
- The original file name to be used when sending the binary data item.mimeType
- The mime type of the data.
-
BinaryData
public BinaryData(@Nonnull String name, @Nonnull byte[] data, @Nonnull String filename, @Nonnull String mimeType, @Nullable Charset charset) Creates a new binary data item. Uses the default charset.- Parameters:
name
- The name of the binary data item when sending the request.data
- The binary data to be sent with the request.filename
- The original file name to be used when sending the binary data item.mimeType
- The mime type of the data.charset
- The charset for the mime type.
-
-
Method Details
-
getCharset
- Returns:
- The charset for the mime type.
-
getContentType
public org.apache.http.entity.ContentType getContentType()- Returns:
- The content type of the data, combines the mime type and the charset.
-
getData
public byte[] getData()- Returns:
- The binary data to be sent with the request.
-
getFilename
- Returns:
- The original file name to be used when sending the binary data item.
-
getMimeType
- Returns:
- The mime type of the data.
-
getName
- Returns:
- The name of the binary data item when sending the request.
-