jfileupload.transfer.client.http
Class CustomFilePartSource

java.lang.Object
  extended by jfileupload.transfer.client.http.CustomFilePartSource
All Implemented Interfaces:
org.apache.commons.httpclient.methods.multipart.PartSource

public class CustomFilePartSource
extends java.lang.Object
implements org.apache.commons.httpclient.methods.multipart.PartSource

Custom FilePartSource implementation.


Field Summary
static boolean FULLNAME
           
 
Constructor Summary
CustomFilePartSource(java.io.File file, java.util.List listeners)
          Constructor for CustomFilePartSource.
CustomFilePartSource(java.io.File file, java.util.List listeners, java.lang.String altfilename)
          Constructor for CustomFilePartSource.
CustomFilePartSource(java.io.File file, java.util.List listeners, java.lang.String altfilename, long resumeoffset)
          Constructor for CustomFilePartSource.
CustomFilePartSource(java.io.File file, java.util.List listeners, java.lang.String altfilename, long resumeoffset, long maxlength, Conf cnf)
          Constructor for CustomFilePartSource.
CustomFilePartSource(java.lang.String fileName, java.io.File file)
          Constructor for FilePartSource.
 
Method Summary
 void close()
           
 java.io.InputStream createInputStream()
          Return a new InputStream for the current filename.
 java.lang.String getFileName()
          Return the current filename
 long getLength()
          Return the length of the file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FULLNAME

public static boolean FULLNAME
Constructor Detail

CustomFilePartSource

public CustomFilePartSource(java.io.File file,
                            java.util.List listeners,
                            java.lang.String altfilename,
                            long resumeoffset,
                            long maxlength,
                            Conf cnf)
                     throws java.io.FileNotFoundException
Constructor for CustomFilePartSource.

Parameters:
file - file to upload
listeners - listeners to be notified
altfilename - alternative filename
resumeoffset - resume offset
maxlength - maximum length
conf -
Throws:
java.io.FileNotFoundException

CustomFilePartSource

public CustomFilePartSource(java.io.File file,
                            java.util.List listeners,
                            java.lang.String altfilename,
                            long resumeoffset)
                     throws java.io.FileNotFoundException
Constructor for CustomFilePartSource.

Parameters:
file - file to upload
listeners - listeners to be notified
altfilename - alternative filename
resumeoffset - resume offset
Throws:
java.io.FileNotFoundException

CustomFilePartSource

public CustomFilePartSource(java.io.File file,
                            java.util.List listeners,
                            java.lang.String altfilename)
                     throws java.io.FileNotFoundException
Constructor for CustomFilePartSource.

Parameters:
file -
listeners -
altfilename - alternative filename
Throws:
java.io.FileNotFoundException

CustomFilePartSource

public CustomFilePartSource(java.io.File file,
                            java.util.List listeners)
                     throws java.io.FileNotFoundException
Constructor for CustomFilePartSource.

Parameters:
file -
listeners -
Throws:
java.io.FileNotFoundException

CustomFilePartSource

public CustomFilePartSource(java.lang.String fileName,
                            java.io.File file)
                     throws java.io.FileNotFoundException
Constructor for FilePartSource.

Parameters:
fileName - the file name of the FilePart
file - the source File for the FilePart
Throws:
java.io.FileNotFoundException - if the file does not exist or cannot be read
Method Detail

getLength

public long getLength()
Return the length of the file

Specified by:
getLength in interface org.apache.commons.httpclient.methods.multipart.PartSource
Returns:
the length of the file.
See Also:
PartSource.getLength()

getFileName

public java.lang.String getFileName()
Return the current filename

Specified by:
getFileName in interface org.apache.commons.httpclient.methods.multipart.PartSource
Returns:
the filename.
See Also:
PartSource.getFileName()

createInputStream

public java.io.InputStream createInputStream()
                                      throws java.io.IOException
Return a new InputStream for the current filename.

Specified by:
createInputStream in interface org.apache.commons.httpclient.methods.multipart.PartSource
Returns:
the new input stream.
Throws:
java.io.IOException - If an IO problem occurs.
See Also:
PartSource.createInputStream()

close

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