Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_CONTENT_TYPE
Default content encoding of file attachments.
|
static String |
DEFAULT_TRANSFER_ENCODING
Default transfer encoding of file attachments.
|
protected static String |
FILE_NAME
Attachment's file name
|
CHARSET, CHARSET_BYTES, CONTENT_DISPOSITION, CONTENT_DISPOSITION_BYTES, CONTENT_ID, CONTENT_ID_BYTES, CONTENT_TRANSFER_ENCODING, CONTENT_TRANSFER_ENCODING_BYTES, CONTENT_TYPE, CONTENT_TYPE_BYTES, CRLF, CRLF_BYTES, EXTRA, EXTRA_BYTES, FORM_DATA_DISPOSITION_TYPE, FORM_DATA_DISPOSITION_TYPE_BYTES, NAME, NAME_BYTES, QUOTE, QUOTE_BYTES
Constructor and Description |
---|
FilePart(String name,
File file)
FilePart Constructor.
|
FilePart(String name,
File file,
String contentType,
String charset)
FilePart Constructor.
|
FilePart(String name,
PartSource partSource)
FilePart Constructor.
|
FilePart(String name,
PartSource partSource,
String contentType,
String charset) |
FilePart(String name,
PartSource partSource,
String contentType,
String charset,
String contentId)
FilePart Constructor.
|
FilePart(String name,
String fileName,
File file)
FilePart Constructor.
|
FilePart(String name,
String fileName,
File file,
String contentType,
String charset)
FilePart Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected long |
dispositionHeaderLength() |
PartSource |
getSource()
Returns the source of the file part.
|
long |
getStalledTime() |
protected long |
lengthOfData()
Return the length of the data.
|
protected void |
sendData(OutputStream out)
Write the data in "source" to the specified stream.
|
protected void |
sendDispositionHeader(OutputStream out)
Write the disposition header to the output stream
|
void |
setStalledTime(long ms) |
getCharSet, getContentId, getContentType, getName, getTransferEncoding, setCharSet, setContentId, setContentType, setName, setTransferEncoding
contentIdHeaderLength, contentTypeHeaderLength, endLength, endOfHeaderLength, getDispositionType, getLengthOfParts, length, send, sendContentIdHeader, sendContentTypeHeader, sendEnd, sendEndOfHeader, sendMessageEnd, sendPart, sendParts, sendStart, sendTransferEncodingHeader, setDispositionType, toString, transferEncodingHeaderLength
public static final String DEFAULT_CONTENT_TYPE
public static final String DEFAULT_TRANSFER_ENCODING
protected static final String FILE_NAME
public FilePart(String name, PartSource partSource, String contentType, String charset, String contentId)
name
- the name for this partpartSource
- the source for this partcontentType
- the content type for this part, if null
the default
is usedcharset
- the charset encoding for this part, if null
the default
is usedpublic FilePart(String name, PartSource partSource, String contentType, String charset)
public FilePart(String name, PartSource partSource)
name
- the name for this partpartSource
- the source for this partpublic FilePart(String name, File file) throws FileNotFoundException
name
- the name of the file partfile
- the file to postFileNotFoundException
- if the file is not a normal file or if it is not readable.public FilePart(String name, File file, String contentType, String charset) throws FileNotFoundException
name
- the name of the file partfile
- the file to postcontentType
- the content type for this part, if null
the default
is usedcharset
- the charset encoding for this part, if null
the default
is usedFileNotFoundException
- if the file is not a normal file or if it is not readable.public FilePart(String name, String fileName, File file) throws FileNotFoundException
name
- the name of the file partfileName
- the file namefile
- the file to postFileNotFoundException
- if the file is not a normal file or if it is not readable.public FilePart(String name, String fileName, File file, String contentType, String charset) throws FileNotFoundException
name
- the name of the file partfileName
- the file namefile
- the file to postcontentType
- the content type for this part, if null
the default
is usedcharset
- the charset encoding for this part, if null
the default
is usedFileNotFoundException
- if the file is not a normal file or if it is not readable.protected void sendDispositionHeader(OutputStream out) throws IOException
sendDispositionHeader
in class Part
out
- The output streamIOException
- If an IO problem occursprotected long dispositionHeaderLength()
dispositionHeaderLength
in class Part
protected void sendData(OutputStream out) throws IOException
sendData
in class Part
out
- The output stream.IOException
- if an IO problem occurs.public void setStalledTime(long ms)
public long getStalledTime()
public PartSource getSource()
protected long lengthOfData()
lengthOfData
in class Part
Copyright © 2014. All Rights Reserved.