|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Thread
chemaxon.util.UploadThread
public class UploadThread
Class for uploading a file from the client side to the server side via HTML forms using a thread.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary |
|---|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
UploadThread()
|
|
| Method Summary | |
|---|---|
int |
getData()
Returns the saved data in bytes. |
java.lang.String |
getDefaultFileName()
Returns the original name of saved file. |
java.lang.Exception |
getError()
For retrieving stored exceptions. |
java.io.File |
getFile()
Returns the file object. |
java.lang.String |
getFileContent()
Returns the file content, if the selected file haven't been saved on the server side. |
java.lang.String |
getFileName()
Returns the name of saved file. |
int |
getFileSize()
Returns the size of saved file. |
java.lang.String |
getParameter(java.lang.String name)
Returns the value of parameter posted by the HTML form. |
java.util.Enumeration |
getParameterNames()
Returns the names of parameters posted by the HTML form. |
int |
getPercent()
Returns the rate of saved data and whole data. |
boolean |
getSuccess()
Indicates if the operation was successful. |
boolean |
isFinished()
Returns true if uploading has finished, else returns false. |
void |
run()
Starts uploading. |
void |
setFinished(boolean f)
Finishes the upload process. |
void |
setParams(java.lang.String type,
int length,
java.io.InputStream is)
Setting parameters. |
void |
setParams(java.lang.String type,
int length,
java.io.InputStream is,
java.lang.String dir)
Seting parameters. |
void |
setParams(java.lang.String type,
int length,
java.io.InputStream is,
java.lang.String dir,
java.lang.String tmp)
Setting the parameters. |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public UploadThread()
| Method Detail |
|---|
public void setParams(java.lang.String type,
int length,
java.io.InputStream is)
getFileContent().
type - The type of the request, can be determined by the
request.getContentType() function.length - The length of the request, can be determined by the
request.getContentLength() function.is - The inputstream of the request, can be
determined by the request.getInputStream() function.
public void setParams(java.lang.String type,
int length,
java.io.InputStream is,
java.lang.String dir)
type - The type of the request, can be determined by the
request.getContentType() method.length - The length of the request, can be determined by the
request.getContentLength() method.is - The inputstream of the request, can be determined by the
request.getInputStream() method.dir - The directory of the server in which the file will be saved
with its original name.
public void setParams(java.lang.String type,
int length,
java.io.InputStream is,
java.lang.String dir,
java.lang.String tmp)
savedFileName.
type - The type of the request, can be determined by the
request.getContentType() funtion.length - The length of the request, can be determined by the
request.getContentLength() funtion.is - The inputstream of the request, can be determined by the
request.getInputStream() funtion.dir - The directory of the server in which the file will be saved.tmp - The name of the file as which it will be saved in the
dir directory.public java.lang.String getFileContent()
public int getData()
public java.lang.String getFileName()
public java.io.File getFile()
public int getFileSize()
public java.lang.String getDefaultFileName()
public java.util.Enumeration getParameterNames()
public java.lang.String getParameter(java.lang.String name)
name - Name of the parameter.public boolean isFinished()
true if uploading has finished, else returns false.
public void setFinished(boolean f)
public int getPercent()
public void run()
run in interface java.lang.Runnablerun in class java.lang.Threadpublic boolean getSuccess()
true, if the file was saved successfullypublic java.lang.Exception getError()
null if there were no exceptions.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||