public class HdaFilePart
extends org.apache.commons.httpclient.methods.multipart.FilePart
Modifier and Type | Class and Description |
---|---|
protected static class |
HdaFilePart.TransferFilePartSource
Converts an IDataFile into a PartSource
|
DEFAULT_CHARSET, DEFAULT_CONTENT_TYPE, DEFAULT_TRANSFER_ENCODING, FILE_NAME
BOUNDARY, BOUNDARY_BYTES, CHARSET, CHARSET_BYTES, CONTENT_DISPOSITION, CONTENT_DISPOSITION_BYTES, CONTENT_TRANSFER_ENCODING, CONTENT_TRANSFER_ENCODING_BYTES, CONTENT_TYPE, CONTENT_TYPE_BYTES, CRLF, CRLF_BYTES, EXTRA, EXTRA_BYTES, QUOTE, QUOTE_BYTES
Constructor and Description |
---|
HdaFilePart(String name,
TransferFile fileInfo)
FilePart Constructor.
|
HdaFilePart(String name,
TransferFile fileInfo,
String charset)
FilePart Constructor.
|
Modifier and Type | Method and Description |
---|---|
static byte[] |
getCharsetBytes(String data,
String charset)
Converts the specified string to byte array of ASCII characters.
|
String |
getTransferEncoding()
Returns the transfer encoding of this part.
|
protected void |
sendDispositionHeader(OutputStream out)
Write the disposition header to the output stream
|
getSource, lengthOfData, sendData
getCharSet, getContentType, getName, setCharSet, setContentType, setName, setTransferEncoding
public HdaFilePart(String name, TransferFile fileInfo, String charset)
name
- the parameter namefileInfo
- the IDataFile object describing the file to publishcharset
- encoding for the filenamepublic HdaFilePart(String name, TransferFile fileInfo)
name
- the parameter namefileInfo
- the IDataFile object describing the file to publishpublic String getTransferEncoding()
getTransferEncoding
in class org.apache.commons.httpclient.methods.multipart.PartBase
protected void sendDispositionHeader(OutputStream out) throws IOException
sendDispositionHeader
in class org.apache.commons.httpclient.methods.multipart.FilePart
out
- The output streamIOException
- If an IO problem occurspublic static byte[] getCharsetBytes(String data, String charset)
data
- the string to be encodedcharset
- the charset of the encoding, if null, "UTF-8" is assumed