org.apache.commons.httpclient.methods.multipart
public class FilePart extends PartBase
Since: 2.0
Field Summary | |
---|---|
static String | DEFAULT_CHARSET Default charset of file attachments. |
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 |
Constructor Summary | |
---|---|
FilePart(String name, PartSource partSource, String contentType, String charset)
FilePart Constructor.
| |
FilePart(String name, PartSource partSource)
FilePart Constructor.
| |
FilePart(String name, File file)
FilePart Constructor.
| |
FilePart(String name, File file, String contentType, String charset)
FilePart Constructor.
| |
FilePart(String name, String fileName, File file)
FilePart Constructor.
| |
FilePart(String name, String fileName, File file, String contentType, String charset)
FilePart Constructor.
|
Method Summary | |
---|---|
protected PartSource | getSource()
Returns the source of the file part.
|
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 |
Parameters: name the name for this part partSource the source for this part contentType the content type for this part, if null
the
default
is used charset the charset encoding for this part, if null
the
default
is used
Parameters: name the name for this part partSource the source for this part
Parameters: name the name of the file part file the file to post
Throws: FileNotFoundException if the file is not a normal file or if it is not readable.
Parameters: name the name of the file part file the file to post contentType the content type for this part, if null
the
default
is used charset the charset encoding for this part, if null
the
default
is used
Throws: FileNotFoundException if the file is not a normal file or if it is not readable.
Parameters: name the name of the file part fileName the file name file the file to post
Throws: FileNotFoundException if the file is not a normal file or if it is not readable.
Parameters: name the name of the file part fileName the file name file the file to post contentType the content type for this part, if null
the
default
is used charset the charset encoding for this part, if null
the
default
is used
Throws: FileNotFoundException if the file is not a normal file or if it is not readable.
Returns: The source.
Returns: The length.
Throws: IOException if an IO problem occurs
See Also: lengthOfData
Parameters: out The output stream.
Throws: IOException if an IO problem occurs.
See Also: sendData
Parameters: out The output stream
Throws: IOException If an IO problem occurs
See Also: sendDispositionHeader