Interface Part

All Known Implementing Classes:
AbstractFilePart, ByteArrayPart, FilePart, PartBase, StringPart

public interface Part
  • Field Details

    • CRLF_BYTES

      static final byte[] CRLF_BYTES
      Carriage return/linefeed as a byte array
    • QUOTE_BYTE

      static final byte QUOTE_BYTE
      Content dispostion as a byte
      See Also:
    • EXTRA_BYTES

      static final byte[] EXTRA_BYTES
      Extra characters as a byte array
    • CONTENT_DISPOSITION_BYTES

      static final byte[] CONTENT_DISPOSITION_BYTES
      Content dispostion as a byte array
    • FORM_DATA_DISPOSITION_TYPE_BYTES

      static final byte[] FORM_DATA_DISPOSITION_TYPE_BYTES
      form-data as a byte array
    • NAME_BYTES

      static final byte[] NAME_BYTES
      name as a byte array
    • CONTENT_TYPE_BYTES

      static final byte[] CONTENT_TYPE_BYTES
      Content type header as a byte array
    • CHARSET_BYTES

      static final byte[] CHARSET_BYTES
      Content charset as a byte array
    • CONTENT_TRANSFER_ENCODING_BYTES

      static final byte[] CONTENT_TRANSFER_ENCODING_BYTES
      Content type header as a byte array
    • CONTENT_ID_BYTES

      static final byte[] CONTENT_ID_BYTES
      Content type header as a byte array
  • Method Details

    • getName

      String getName()
      Return the name of this part.
      Returns:
      The name.
    • getContentType

      String getContentType()
      Returns the content type of this part.
      Returns:
      the content type, or null to exclude the content type header
    • getCharset

      Charset getCharset()
      Return the character encoding of this part.
      Returns:
      the character encoding, or null to exclude the character encoding header
    • getTransferEncoding

      String getTransferEncoding()
      Return the transfer encoding of this part.
      Returns:
      the transfer encoding, or null to exclude the transfer encoding header
    • getContentId

      String getContentId()
      Return the content ID of this part.
      Returns:
      the content ID, or null to exclude the content ID header
    • getDispositionType

      String getDispositionType()
      Gets the disposition-type to be used in Content-Disposition header
      Returns:
      the disposition-type
    • write

      void write(OutputStream out, byte[] boundary) throws IOException
      Write all the data to the output stream. If you override this method make sure to override #length() as well
      Parameters:
      out - The output stream
      boundary - the boundary
      Throws:
      IOException - If an IO problem occurs.
    • length

      long length(byte[] boundary)
      Return the full length of all the data. If you override this method make sure to override #send(OutputStream) as well
      Returns:
      long The length.
    • write

      long write(WritableByteChannel target, byte[] boundary) throws IOException
      Throws:
      IOException