|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.httpclient.methods.multipart.Part
org.apache.commons.httpclient.methods.multipart.FilePart
This class implements a part of a Multipart post object that consists of a file.
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 |
protected static byte[] |
FILE_NAME_BYTES
Attachment's file name as a byte array |
Fields inherited from class org.apache.commons.httpclient.methods.multipart.Part |
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 Summary | |
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 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 | |
String |
getCharSet()
Return the character encoding of this part. |
String |
getContentType()
Return the content type of this part. |
String |
getName()
Return the name. |
String |
getTransferEncoding()
Return the transfer encoding of this 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 |
Methods inherited from class org.apache.commons.httpclient.methods.multipart.Part |
getBoundary, getLengthOfParts, length, send, sendContentTypeHeader, sendEnd, sendEndOfHeader, sendParts, sendStart, sendTransferEncodingHeader, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String DEFAULT_CONTENT_TYPE
public static final String DEFAULT_CHARSET
public static final String DEFAULT_TRANSFER_ENCODING
protected static final String FILE_NAME
protected static final byte[] FILE_NAME_BYTES
Constructor Detail |
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 partcharset
- the charset encoding for this partpublic 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 post
FileNotFoundException
- 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 the filecharset
- the charset encoding of the file
FileNotFoundException
- 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 post
FileNotFoundException
- 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 the filecharset
- the charset encoding of the file
FileNotFoundException
- if the file is not a normal
file or if it is not readable.Method Detail |
public String getName()
getName
in class Part
Part.getName()
public String getContentType()
getContentType
in class Part
public String getCharSet()
getCharSet
in class Part
public String getTransferEncoding()
getTransferEncoding
in class Part
protected void sendDispositionHeader(OutputStream out) throws IOException
sendDispositionHeader
in class Part
out
- The output stream
IOException
- If an IO problem occursPart.sendDispositionHeader(OutputStream)
protected void sendData(OutputStream out) throws IOException
sendData
in class Part
out
- The output stream.
IOException
- if an IO problem occurs.Part.sendData(OutputStream)
protected long lengthOfData() throws IOException
lengthOfData
in class Part
IOException
- if an IO problem occursPart.lengthOfData()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |