public class CustomFilePart
extends org.apache.commons.httpclient.methods.multipart.FilePart
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 |
---|
CustomFilePart(java.lang.String name,
java.io.File file)
CustomFilePart Constructor.
|
CustomFilePart(java.lang.String name,
java.io.File file,
java.lang.String contentType,
java.lang.String charset)
CustomFilePart Constructor.
|
CustomFilePart(java.lang.String name,
org.apache.commons.httpclient.methods.multipart.PartSource partSource)
CustomFilePart Constructor.
|
CustomFilePart(java.lang.String name,
org.apache.commons.httpclient.methods.multipart.PartSource partSource,
java.lang.String contentType,
java.lang.String charset)
CustomFilePart Constructor.
|
CustomFilePart(java.lang.String name,
java.lang.String fileName,
java.io.File file)
CustomFilePart Constructor.
|
CustomFilePart(java.lang.String name,
java.lang.String fileName,
java.io.File file,
java.lang.String contentType,
java.lang.String charset)
CustomFilePart Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected void |
sendData(java.io.OutputStream out)
Write the data in "source" to the specified stream.
|
protected void |
sendDispositionHeader(java.io.OutputStream out)
Write the disposition header to the output stream
|
getSource, lengthOfData
getCharSet, getContentType, getName, getTransferEncoding, setCharSet, setContentType, setName, setTransferEncoding
public CustomFilePart(java.lang.String name, org.apache.commons.httpclient.methods.multipart.PartSource partSource, java.lang.String contentType, java.lang.String charset)
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 CustomFilePart(java.lang.String name, org.apache.commons.httpclient.methods.multipart.PartSource partSource)
name
- the name for this partpartSource
- the source for this partpublic CustomFilePart(java.lang.String name, java.io.File file) throws java.io.FileNotFoundException
name
- the name of the file partfile
- the file to postjava.io.FileNotFoundException
- if the file is not a normal
file or if it is not readable.public CustomFilePart(java.lang.String name, java.io.File file, java.lang.String contentType, java.lang.String charset) throws java.io.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 usedjava.io.FileNotFoundException
- if the file is not a normal
file or if it is not readable.public CustomFilePart(java.lang.String name, java.lang.String fileName, java.io.File file) throws java.io.FileNotFoundException
name
- the name of the file partfileName
- the file namefile
- the file to postjava.io.FileNotFoundException
- if the file is not a normal
file or if it is not readable.public CustomFilePart(java.lang.String name, java.lang.String fileName, java.io.File file, java.lang.String contentType, java.lang.String charset) throws java.io.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 usedjava.io.FileNotFoundException
- if the file is not a normal
file or if it is not readable.protected void sendDispositionHeader(java.io.OutputStream out) throws java.io.IOException
sendDispositionHeader
in class org.apache.commons.httpclient.methods.multipart.FilePart
out
- The output streamjava.io.IOException
- If an IO problem occursPart.sendDispositionHeader(OutputStream)
protected void sendData(java.io.OutputStream out) throws java.io.IOException
sendData
in class org.apache.commons.httpclient.methods.multipart.FilePart
out
- The output stream.java.io.IOException
- if an IO problem occurs.Part.sendData(OutputStream)
public void close() throws java.io.IOException
java.io.IOException