Package com.ning.http.client.multipart
Class AbstractFilePart
java.lang.Object
com.ning.http.client.multipart.PartBase
com.ning.http.client.multipart.AbstractFilePart
- All Implemented Interfaces:
Part
- Direct Known Subclasses:
ByteArrayPart,FilePart
This class is an adaptation of the Apache HttpClient implementation
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault content encoding of file attachments.static final StringDefault transfer encoding of file attachments.Fields inherited from class com.ning.http.client.multipart.PartBase
AHC_ALLOW_UTF8, HEADERS_CHARSETFields inherited from interface com.ning.http.client.multipart.Part
CHARSET_BYTES, CONTENT_DISPOSITION_BYTES, CONTENT_ID_BYTES, CONTENT_TRANSFER_ENCODING_BYTES, CONTENT_TYPE_BYTES, CRLF_BYTES, EXTRA_BYTES, FORM_DATA_DISPOSITION_TYPE_BYTES, NAME_BYTES, QUOTE_BYTE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected byte[]protected byte[]generateFileStart(byte[] boundary) longvoidsetFileName(String fileName) voidsetStalledTime(long ms) toString()protected voidvisitDispositionHeader(PartVisitor visitor) Methods inherited from class com.ning.http.client.multipart.PartBase
addCustomHeader, getCharset, getContentId, getContentType, getDataLength, getDispositionType, getName, getTransferEncoding, length, sendData, setCustomHeaders, setDispositionType, visitContentIdHeader, visitContentTypeHeader, visitCustomHeaders, visitEnd, visitEndOfHeaders, visitStart, visitTransferEncodingHeader, write
-
Field Details
-
DEFAULT_CONTENT_TYPE
Default content encoding of file attachments.- See Also:
-
DEFAULT_TRANSFER_ENCODING
Default transfer encoding of file attachments.- See Also:
-
-
Constructor Details
-
AbstractFilePart
public AbstractFilePart(String name, String contentType, Charset charset, String contentId, String transferEncoding) FilePart Constructor.- Parameters:
name- the name for this partpartSource- the source for this partcontentType- the content type for this part, ifnullthedefaultis usedcharset- the charset encoding for this part
-
-
Method Details
-
visitDispositionHeader
- Overrides:
visitDispositionHeaderin classPartBase- Throws:
IOException
-
generateFileStart
- Throws:
IOException
-
generateFileEnd
- Throws:
IOException
-
setStalledTime
public void setStalledTime(long ms) -
getStalledTime
public long getStalledTime() -
setFileName
-
getFileName
-
toString
-