Class BinaryData

java.lang.Object
de.xima.fc.http.params.BinaryData

public final class BinaryData extends Object
Binary data that can be added to a HTTP request.
Since:
7.0.3
Author:
XIMA MEDIA GmbH
  • 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

      public Charset 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

      public String getFilename()
      Returns:
      The original file name to be used when sending the binary data item.
    • getMimeType

      public String getMimeType()
      Returns:
      The mime type of the data.
    • getName

      public String getName()
      Returns:
      The name of the binary data item when sending the request.