|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectwjhk.jupload2.upload.UploadFileData
class UploadFileData
| Constructor Summary | |
|---|---|
UploadFileData(FileData fileDataParam,
FileUploadThread fileUploadThreadParam,
UploadPolicy uploadPolicyParam)
Standard constructor for the UploadFileData class. |
|
| Method Summary | |
|---|---|
void |
afterUpload()
This method closes the inputstream, and remove the file from the filepanel. |
void |
appendFileProperties(wjhk.jupload2.upload.helper.ByteArrayEncoder bae)
Called during the upload, by the FileUploadThread. |
void |
beforeUpload()
Prepare the fileData to upload. |
boolean |
canRead()
Indicate if this file can be read. |
String |
getDirectory()
Get the directory of the file. |
File |
getFile()
Standard getter, for the file described by the FileData instance. |
String |
getFileExtension()
|
long |
getFileLength()
|
String |
getFileName()
Get the original filename. |
InputStream |
getInputStream()
This function creates an InputStream from this file. |
Date |
getLastModified()
|
(package private) String |
getMD5()
Retrieves the MD5 sum of the file. |
String |
getMimeType()
This function return the FileData content type. |
String |
getRelativeDir()
Retrieves the path of this file relative to it's root dir |
(package private) long |
getRemainingLength()
Get the number of files that are still to upload. |
String |
getUploadFilename(int index)
Retrieves the file name, that should be used in the server application. |
long |
getUploadLength()
Get size of upload, which may be different from th actual file length. |
String |
getUploadName(int index)
Retrieves the upload file name, that should be sent to the server. |
(package private) void |
uploadFile(OutputStream outputStream,
long amount)
This methods writes the file data (see FileData.getInputStream()
to the given outputStream (the output toward the HTTP server). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UploadFileData(FileData fileDataParam,
FileUploadThread fileUploadThreadParam,
UploadPolicy uploadPolicyParam)
fileDataParam - The file data the this instance must transmist.fileUploadThreadParam - The current instance of
FileUploadThreaduploadPolicyParam - The current upload policy, instance of
UploadPolicy| Method Detail |
|---|
long getRemainingLength()
FileData.getUploadLength().
getInputStream()
String getMD5()
throws JUploadException
JUploadException
void uploadFile(OutputStream outputStream,
long amount)
throws JUploadException
FileData.getInputStream()
to the given outputStream (the output toward the HTTP server).
outputStream - The stream on which the data is to be written.amount - The number of bytes to write.
JUploadException - if an I/O error occurs.public void afterUpload()
FileData.afterUpload().
afterUpload in interface FileDataFileData.afterUpload()
public void appendFileProperties(wjhk.jupload2.upload.helper.ByteArrayEncoder bae)
throws JUploadIOException
FileUploadThread. The FileData
instance should then call the
ByteArrayEncoder.appendFileProperty(String, String) method to add
each file property to the current upload.
appendFileProperties in interface FileDatabae - The byte encoder, where the properties must be added
JUploadIOException - Encapsulation of the IOException, if any would occurs.ByteArrayEncoder.appendFileProperty(String, String)
public void beforeUpload()
throws JUploadException
PictureFileData. This method is called before
the upload of this file.
beforeUpload in interface FileDataJUploadException - Encapsulation of the Exception, if any would occurs.FileUploadThreadpublic boolean canRead()
canRead in interface FileDatapublic String getDirectory()
getDirectory in interface FileDatapublic File getFile()
getFile in interface FileDatapublic String getFileExtension()
getFileExtension in interface FileDatapublic long getFileLength()
getFileLength in interface FileDatapublic String getFileName()
getFileName in interface FileData
public InputStream getInputStream()
throws JUploadException
FileUploadThread class then reads bytes from it and transfers
them to the webserver. The caller is responsible for closing this stream.
getInputStream in interface FileDataJUploadException - Encapsulation of the Exception, if any would occurs.public Date getLastModified()
getLastModified in interface FileDatapublic String getMimeType()
getMimeType in interface FileDatapublic String getRelativeDir()
getRelativeDir in interface FileData
public String getUploadFilename(int index)
throws JUploadException
index - The index of this file in the current request to the server.
JUploadException - Thrown when an error occurs.UploadPolicy.getUploadFilename(FileData, int)public String getUploadName(int index)
UploadPolicy.getUploadFilename(FileData, int) method.
index - The index of this file in the current request to the server.
UploadPolicy.getUploadName(FileData, int)
public long getUploadLength()
throws JUploadException
FileData
getUploadLength in interface FileDataJUploadException - Encapsulation of the Exception, if any would occurs.FileData.getUploadLength()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||