javazoom.transfer.client.http
Class CustomFilePart

java.lang.Object
  extended byorg.apache.commons.httpclient.methods.multipart.Part
      extended byorg.apache.commons.httpclient.methods.multipart.PartBase
          extended byorg.apache.commons.httpclient.methods.multipart.FilePart
              extended byjavazoom.transfer.client.http.CustomFilePart

public class CustomFilePart
extends org.apache.commons.httpclient.methods.multipart.FilePart

Cust FilePart implementation.


Field Summary
 
Fields inherited from class org.apache.commons.httpclient.methods.multipart.FilePart
DEFAULT_CHARSET, DEFAULT_CONTENT_TYPE, DEFAULT_TRANSFER_ENCODING, FILE_NAME, FILE_NAME_BYTES
 
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
CustomFilePart(java.lang.String name, java.io.File file)
          CustomFilePart Constructor.
CustomFilePart(java.lang.String name, java.io.File file, java.lang.String contentType, java.lang.String charset)
          CustomFilePart Constructor.
CustomFilePart(java.lang.String name, org.apache.commons.httpclient.methods.multipart.PartSource partSource)
          CustomFilePart Constructor.
CustomFilePart(java.lang.String name, org.apache.commons.httpclient.methods.multipart.PartSource partSource, java.lang.String contentType, java.lang.String charset)
          CustomFilePart Constructor.
CustomFilePart(java.lang.String name, java.lang.String fileName, java.io.File file)
          CustomFilePart Constructor.
CustomFilePart(java.lang.String name, java.lang.String fileName, java.io.File file, java.lang.String contentType, java.lang.String charset)
          CustomFilePart Constructor.
 
Method Summary
 void close()
           
protected  void sendData(java.io.OutputStream out)
          Write the data in "source" to the specified stream.
protected  void sendDispositionHeader(java.io.OutputStream out)
          Write the disposition header to the output stream
 
Methods inherited from class org.apache.commons.httpclient.methods.multipart.FilePart
getSource, lengthOfData
 
Methods inherited from class org.apache.commons.httpclient.methods.multipart.PartBase
getCharSet, getContentType, getName, getTransferEncoding, setCharSet, setContentType, setName, setTransferEncoding
 
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
 

Constructor Detail

CustomFilePart

public CustomFilePart(java.lang.String name,
                      org.apache.commons.httpclient.methods.multipart.PartSource partSource,
                      java.lang.String contentType,
                      java.lang.String charset)
CustomFilePart 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

CustomFilePart

public CustomFilePart(java.lang.String name,
                      org.apache.commons.httpclient.methods.multipart.PartSource partSource)
CustomFilePart Constructor.

Parameters:
name - the name for this part
partSource - the source for this part

CustomFilePart

public CustomFilePart(java.lang.String name,
                      java.io.File file)
               throws java.io.FileNotFoundException
CustomFilePart Constructor.

Parameters:
name - the name of the file part
file - the file to post
Throws:
java.io.FileNotFoundException - if the file is not a normal file or if it is not readable.

CustomFilePart

public CustomFilePart(java.lang.String name,
                      java.io.File file,
                      java.lang.String contentType,
                      java.lang.String charset)
               throws java.io.FileNotFoundException
CustomFilePart 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:
java.io.FileNotFoundException - if the file is not a normal file or if it is not readable.

CustomFilePart

public CustomFilePart(java.lang.String name,
                      java.lang.String fileName,
                      java.io.File file)
               throws java.io.FileNotFoundException
CustomFilePart Constructor.

Parameters:
name - the name of the file part
fileName - the file name
file - the file to post
Throws:
java.io.FileNotFoundException - if the file is not a normal file or if it is not readable.

CustomFilePart

public CustomFilePart(java.lang.String name,
                      java.lang.String fileName,
                      java.io.File file,
                      java.lang.String contentType,
                      java.lang.String charset)
               throws java.io.FileNotFoundException
CustomFilePart 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:
java.io.FileNotFoundException - if the file is not a normal file or if it is not readable.
Method Detail

sendDispositionHeader

protected void sendDispositionHeader(java.io.OutputStream out)
                              throws java.io.IOException
Write the disposition header to the output stream

Parameters:
out - The output stream
Throws:
java.io.IOException - If an IO problem occurs
See Also:
Part.sendDispositionHeader(OutputStream)

sendData

protected void sendData(java.io.OutputStream out)
                 throws java.io.IOException
Write the data in "source" to the specified stream.

Parameters:
out - The output stream.
Throws:
java.io.IOException - if an IO problem occurs.
See Also:
Part.sendData(OutputStream)

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException


Copyright © 1999-2005 JavaZOOM.