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

Direct Known Subclasses:
    StringPart, PartBase, ContentTypeFilePart, FilePart

Abstract class for one Part of a multipart post object.
Field Summary
protected static final  String BOUNDARY    The boundary
     
    protected static final  byte[] BOUNDARY_BYTES    The boundary as a byte array.
       
      protected static final  String CRLF    Carriage return/linefeed 
      protected static final  byte[] CRLF_BYTES    Carriage return/linefeed as a byte array 
      protected static final  String QUOTE    Content dispostion characters 
      protected static final  byte[] QUOTE_BYTES    Content dispostion as a byte array 
      protected static final  String EXTRA    Extra characters 
      protected static final  byte[] EXTRA_BYTES    Extra characters as a byte array 
      protected static final  String CONTENT_DISPOSITION    Content dispostion characters 
      protected static final  byte[] CONTENT_DISPOSITION_BYTES    Content dispostion as a byte array 
      protected static final  String CONTENT_TYPE    Content type header 
      protected static final  byte[] CONTENT_TYPE_BYTES    Content type header as a byte array 
      protected static final  String CHARSET    Content charset 
      protected static final  byte[] CHARSET_BYTES    Content charset as a byte array 
      protected static final  String CONTENT_TRANSFER_ENCODING    Content type header 
      protected static final  byte[] CONTENT_TRANSFER_ENCODING_BYTES    Content type header as a byte array 
      Method from org.apache.commons.httpclient.methods.multipart.Part Summary:
      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.Part Detail:
       public static String getBoundary() 
      Deprecated! uses - a constant string. Rather use #getPartBoundary

        Return the boundary string.
       abstract public String getCharSet()
        Return the character encoding of this part.
       abstract public String getContentType()
        Returns the content type of this part.
       public static long getLengthOfParts(Part[] parts) throws IOException 
        Return the total sum of all parts and that of the last boundary
       public static long getLengthOfParts(Part[] parts,
          byte[] partBoundary) throws IOException 
        Gets the length of the multipart message including the given parts.
       abstract public String getName()
        Return the name of this part.
       protected byte[] getPartBoundary() 
        Gets the part boundary to be used.
       abstract public String getTransferEncoding()
        Return the transfer encoding of this part.
       public boolean isRepeatable() 
        Tests if this part can be sent more than once.
       public long length() throws IOException 
        Return the full length of all the data. If you override this method make sure to override #send(OutputStream) as well
       abstract protected long lengthOfData() throws IOException
        Return the length of the main content
       public  void send(OutputStream out) throws IOException 
        Write all the data to the output stream. If you override this method make sure to override #length() as well
       protected  void sendContentTypeHeader(OutputStream out) throws IOException 
        Write the content type header to the specified output stream
       abstract protected  void sendData(OutputStream out) throws IOException
        Write the data to the specified output stream
       protected  void sendDispositionHeader(OutputStream out) throws IOException 
        Write the content disposition header to the specified output stream
       protected  void sendEnd(OutputStream out) throws IOException 
        Write the end data to the output stream.
       protected  void sendEndOfHeader(OutputStream out) throws IOException 
        Write the end of the header to the output stream
       public static  void sendParts(OutputStream out,
          Part[] parts) throws IOException 
        Write all parts and the last boundary to the specified output stream.
       public static  void sendParts(OutputStream out,
          Part[] parts,
          byte[] partBoundary) throws IOException 
        Write all parts and the last boundary to the specified output stream.
       protected  void sendStart(OutputStream out) throws IOException 
        Write the start to the specified output stream
       protected  void sendTransferEncodingHeader(OutputStream out) throws IOException 
        Write the content transfer encoding header to the specified output stream
        void setPartBoundary(byte[] boundaryBytes) 
       public String toString() 
        Return a string representation of this object.