Package com.ning.http.client.multipart
Interface Part
- All Known Implementing Classes:
AbstractFilePart,ByteArrayPart,FilePart,PartBase,StringPart
public interface Part
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byte[]Content charset as a byte arraystatic final byte[]Content dispostion as a byte arraystatic final byte[]Content type header as a byte arraystatic final byte[]Content type header as a byte arraystatic final byte[]Content type header as a byte arraystatic final byte[]Carriage return/linefeed as a byte arraystatic final byte[]Extra characters as a byte arraystatic final byte[]form-data as a byte arraystatic final byte[]name as a byte arraystatic final byteContent dispostion as a byte -
Method Summary
Modifier and TypeMethodDescriptionReturn the character encoding of this part.Return the content ID of this part.Returns the content type of this part.Gets the disposition-type to be used in Content-Disposition headergetName()Return the name of this part.Return the transfer encoding of this part.longlength(byte[] boundary) Return the full length of all the data.voidwrite(OutputStream out, byte[] boundary) Write all the data to the output stream.longwrite(WritableByteChannel target, byte[] boundary)
-
Field Details
-
CRLF_BYTES
static final byte[] CRLF_BYTESCarriage return/linefeed as a byte array -
QUOTE_BYTE
static final byte QUOTE_BYTEContent dispostion as a byte- See Also:
-
EXTRA_BYTES
static final byte[] EXTRA_BYTESExtra characters as a byte array -
CONTENT_DISPOSITION_BYTES
static final byte[] CONTENT_DISPOSITION_BYTESContent dispostion as a byte array -
FORM_DATA_DISPOSITION_TYPE_BYTES
static final byte[] FORM_DATA_DISPOSITION_TYPE_BYTESform-data as a byte array -
NAME_BYTES
static final byte[] NAME_BYTESname as a byte array -
CONTENT_TYPE_BYTES
static final byte[] CONTENT_TYPE_BYTESContent type header as a byte array -
CHARSET_BYTES
static final byte[] CHARSET_BYTESContent charset as a byte array -
CONTENT_TRANSFER_ENCODING_BYTES
static final byte[] CONTENT_TRANSFER_ENCODING_BYTESContent type header as a byte array -
CONTENT_ID_BYTES
static final byte[] CONTENT_ID_BYTESContent 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
nullto exclude the content type header
-
getCharset
Charset getCharset()Return the character encoding of this part.- Returns:
- the character encoding, or
nullto exclude the character encoding header
-
getTransferEncoding
String getTransferEncoding()Return the transfer encoding of this part.- Returns:
- the transfer encoding, or
nullto exclude the transfer encoding header
-
getContentId
String getContentId()Return the content ID of this part.- Returns:
- the content ID, or
nullto exclude the content ID header
-
getDispositionType
String getDispositionType()Gets the disposition-type to be used in Content-Disposition header- Returns:
- the disposition-type
-
write
Write all the data to the output stream. If you override this method make sure to override #length() as well- Parameters:
out- The output streamboundary- 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
- Throws:
IOException
-