org.apache.commons.httpclient.methods.multipart
Class FilePart
This class implements a part of a Multipart post object that
consists of a file.
- Matthew Albright
- Jeff Dever
- Adrian Sutton
- Michael Becke
- Mark Diggory
- Mike Bowler
- Oleg Kalnichevski
- 2.0
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 |
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.
|
FilePart(String name, PartSource partSource) - FilePart Constructor.
|
FilePart(String name, PartSource partSource, String contentType, String charset) - FilePart Constructor.
|
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
|
getBoundary , getCharSet , getContentType , getLengthOfParts , getLengthOfParts , getName , getPartBoundary , getTransferEncoding , isRepeatable , length , lengthOfData , send , sendContentTypeHeader , sendData , sendDispositionHeader , sendEnd , sendEndOfHeader , sendParts , sendParts , sendStart , sendTransferEncodingHeader , toString |
DEFAULT_CHARSET
public static final String DEFAULT_CHARSET
Default charset of file attachments.
DEFAULT_CONTENT_TYPE
public static final String DEFAULT_CONTENT_TYPE
Default content encoding of file attachments.
DEFAULT_TRANSFER_ENCODING
public static final String DEFAULT_TRANSFER_ENCODING
Default transfer encoding of file attachments.
FILE_NAME
protected static final String FILE_NAME
Attachment's file name
FILE_NAME_BYTES
protected static final byte[] FILE_NAME_BYTES
Attachment's file name as a byte array
FilePart
public FilePart(String name,
File file)
throws FileNotFoundException
FilePart Constructor.
name
- the name of the file partfile
- the file to post
FilePart
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
thecharset
- the charset encoding for this part, if null
the
FilePart
public FilePart(String name,
String fileName,
File file)
throws FileNotFoundException
FilePart Constructor.
name
- the name of the file partfileName
- the file namefile
- the file to post
FilePart
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
thecharset
- the charset encoding for this part, if null
the
FilePart
public FilePart(String name,
PartSource partSource)
FilePart Constructor.
name
- the name for this partpartSource
- the source for this part
FilePart
public FilePart(String name,
PartSource partSource,
String contentType,
String charset)
name
- the name for this partpartSource
- the source for this partcontentType
- the content type for this part, if null
thecharset
- the charset encoding for this part, if null
the
getSource
protected PartSource getSource()
Returns the source of the file part.
- The source.
lengthOfData
protected long lengthOfData()
throws IOException
Return the length of the data.
- lengthOfData in interface Part
- The length.
Part.lengthOfData()
sendData
protected void sendData(OutputStream out)
throws IOException
Write the data in "source" to the specified stream.
- sendData in interface Part
out
- The output stream.
Part.sendData(OutputStream)
sendDispositionHeader
protected void sendDispositionHeader(OutputStream out)
throws IOException
Write the disposition header to the output stream
- sendDispositionHeader in interface Part
out
- The output stream
Part.sendDispositionHeader(OutputStream)
Copyright (c) 1999-2005 - Apache Software Foundation