|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nih.nci.caarray.services.util.httpfileuploadapplet.HttpFileUploader
public class HttpFileUploader
This object is the central part of the file upload implementation. It zips all files to be uploaded in one to one relationship before the upload process is started. It contains three ways to do the actual uploading job: using java.net.Socket, java.net.URLConnection and Apatche Jakatar's HttpClient. For the current release HttpClient is used as the way for file upload, since it can upload file as large as up to 300 mk.
Constructor Summary | |
---|---|
HttpFileUploader(java.util.Vector files,
HttpUploadParameters up)
constructor |
Method Summary | |
---|---|
void |
cleanUp()
This method is the actual implementation of the cleanup process. |
void |
cleanUp(java.util.Vector files)
This method is called to removed all temporary zip files after they have been uploaded from the temp directory. |
long |
getBytesSent()
Simply return the current bytsSent value used as part of upload summary. |
java.lang.String |
getCurrentFileName()
This method is called by the thread to pass the current uploading file name to the applet for display, so the user knows what file is being uploaded. |
java.lang.StringBuffer |
getDurationString()
Calculate the day, hour, minute and second used for uploading this batch of files, and compose a StringBuffer to be used by the applet as part of the summary content. |
java.lang.Object[] |
getFailFiles()
returns all failed files to applet so applet can display them as part of the summary popup window. |
java.lang.String |
getFailureMessage()
Returns error message derived from the Exception thrown during the uploading process at the time of this method is called. |
java.lang.String |
getNotifyReply()
Simply returns a string value received from server as part of response. |
java.lang.Object[] |
getOkFiles()
Returns all uploaded files to applet so applet can display them as part of the summary popup window. |
int |
getPercentage()
To calculate the percentage of upload that is completed. |
boolean |
isFailed()
Returns the value isFailed set dynamically during the cause of file upload. |
boolean |
isStopped()
|
boolean |
isZipped()
|
void |
notifyServer(java.lang.String mode)
After a upload, notify the server to start process uploaded files, or clean up the cache if failed. |
void |
setFailureMessage()
|
void |
setStopped(boolean isStopped)
|
boolean |
uploadFilesViaHttpClient()
Implementation of the file upload using Apatche's HttpClient framework. |
boolean |
uploadFilesViaSocket()
The imploemetation of file upload using java.net.Socket. |
boolean |
uploadFilesViaURLConnection()
The method using URLConnection to upload files. |
void |
zipFile(HttpUploadFile uf)
This method puts a single file into a zip format. |
void |
zipFiles()
Zip files into zip file one at a time. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HttpFileUploader(java.util.Vector files, HttpUploadParameters up)
files
- The Vector containing a batch of file names to be uploaded.up
- the HttpUploadParameters object encapsulating all the parameters
passed from the server to the applet.Method Detail |
---|
public boolean isZipped()
public void zipFiles()
public void zipFile(HttpUploadFile uf) throws java.lang.Exception
uf
- The HttpUploadFile object containing all the information about the
file to be uploaded.
java.lang.Exception
- if an error occurs during zip buildingpublic void cleanUp(java.util.Vector files)
files
- The Vector contains all files to be cleaned.public void cleanUp()
public java.lang.String getFailureMessage()
public void setFailureMessage()
public boolean isFailed()
public java.lang.String getNotifyReply()
public java.lang.Object[] getOkFiles()
public java.lang.Object[] getFailFiles()
public long getBytesSent()
public java.lang.StringBuffer getDurationString()
public int getPercentage()
public java.lang.String getCurrentFileName()
public boolean uploadFilesViaURLConnection()
public boolean uploadFilesViaHttpClient()
public boolean uploadFilesViaSocket()
public void notifyServer(java.lang.String mode)
mode
- The string value to indicate what to do for the server.
mode=stop delete uploaded files and block incoming files to be
saved to file system; mode=success, start parsing service;
mode=done, moving onto different page (close applet).public boolean isStopped()
public void setStopped(boolean isStopped)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |