Home » commons-httpclient-3.1-src » org.apache.commons » httpclient » methods » multipart » [javadoc | source]
org.apache.commons.httpclient.methods.multipart
public class: FilePart [javadoc | source]
java.lang.Object
   org.apache.commons.httpclient.methods.multipart.Part
      org.apache.commons.httpclient.methods.multipart.PartBase
         org.apache.commons.httpclient.methods.multipart.FilePart

Direct Known Subclasses:
    ContentTypeFilePart

This class implements a part of a Multipart post object that consists of a file.
Field Summary
public static final  String DEFAULT_CONTENT_TYPE    Default content encoding of file attachments. 
public static final  String DEFAULT_CHARSET    Default charset of file attachments. 
public static final  String DEFAULT_TRANSFER_ENCODING    Default transfer encoding of file attachments. 
protected static final  String FILE_NAME    Attachment's file name 
Fields inherited from org.apache.commons.httpclient.methods.multipart.Part:
BOUNDARY,  BOUNDARY_BYTES,  CRLF,  CRLF_BYTES,  QUOTE,  QUOTE_BYTES,  EXTRA,  EXTRA_BYTES,  CONTENT_DISPOSITION,  CONTENT_DISPOSITION_BYTES,  CONTENT_TYPE,  CONTENT_TYPE_BYTES,  CHARSET,  CHARSET_BYTES,  CONTENT_TRANSFER_ENCODING,  CONTENT_TRANSFER_ENCODING_BYTES
Constructor:
 public FilePart(String name,
    PartSource partSource) 
    FilePart Constructor.
    Parameters:
    name - the name for this part
    partSource - the source for this part
 public FilePart(String name,
    File file) throws FileNotFoundException 
    FilePart Constructor.
    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.
 public FilePart(String name,
    String fileName,
    File file) throws FileNotFoundException 
    FilePart Constructor.
    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.
 public FilePart(String name,
    PartSource partSource,
    String contentType,
    String charset) 
    FilePart Constructor.
    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
 public FilePart(String name,
    File file,
    String contentType,
    String charset) throws FileNotFoundException 
    FilePart Constructor.
    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.
 public FilePart(String name,
    String fileName,
    File file,
    String contentType,
    String charset) throws FileNotFoundException 
    FilePart Constructor.
    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.
Method from org.apache.commons.httpclient.methods.multipart.FilePart Summary:
getSource,   lengthOfData,   sendData,   sendDispositionHeader
Methods from org.apache.commons.httpclient.methods.multipart.PartBase:
getCharSet,   getContentType,   getName,   getTransferEncoding,   setCharSet,   setContentType,   setName,   setTransferEncoding
Methods from org.apache.commons.httpclient.methods.multipart.Part:
getBoundary,   getCharSet,   getContentType,   getLengthOfParts,   getLengthOfParts,   getName,   getPartBoundary,   getTransferEncoding,   isRepeatable,   length,   lengthOfData,   send,   sendContentTypeHeader,   sendData,   sendDispositionHeader,   sendEnd,   sendEndOfHeader,   sendParts,   sendParts,   sendStart,   sendTransferEncodingHeader,   setPartBoundary,   toString
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.commons.httpclient.methods.multipart.FilePart Detail:
 protected PartSource getSource() 
    Returns the source of the file part.
 protected long lengthOfData() throws IOException 
    Return the length of the data.
 protected  void sendData(OutputStream out) throws IOException 
    Write the data in "source" to the specified stream.
 protected  void sendDispositionHeader(OutputStream out) throws IOException 
    Write the disposition header to the output stream