|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread com.isti.util.IstiThread com.isti.util.IstiNotifyThread com.isti.util.FileDownloader
Class FileDownloader downloads a file with optional dialogs.
Field Summary | |
(package private) long |
maxProgressVal
|
Fields inherited from class com.isti.util.IstiThread |
DEFAULT_TERMINATE_WAIT_TIME, terminateFlag |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
FileDownloader(java.lang.String fileNameStr,
java.io.File outputDir,
CallBackStringParam callBackObj,
IstiDialogInterface dialogObj,
ProgressIndicatorInterface progressBarObj)
Creates a file download thread. |
|
FileDownloader(java.lang.String fileNameStr,
java.io.File outputDir,
CallBackStringParam callBackObj,
IstiDialogInterface dialogObj,
ProgressIndicatorInterface progressBarObj,
boolean unzipDownloadedFileFlag)
Creates a file download thread. |
Method Summary | |
protected void |
closeStreams()
Closes the streams. |
protected void |
doThreadFinished(java.lang.String errMsgStr)
Performs thread-finished operations. |
java.io.File |
getOutputFileObj()
Returns the file object for the last file downloaded (or attempted). |
boolean |
isDownloadDone()
Returns the completion status of the download attempt. |
void |
requestDialogFocus()
Perfoms a 'requestFocus()' on the currently-displayed dialog (if any). |
void |
run()
Runs the thread. |
void |
setCallBackObj(CallBackStringParam callBackObj)
Sets the call-back object to use used. |
void |
terminate()
Deprecated. Should use the terminateThread method instead. |
void |
terminateThread(java.lang.String msgStr)
Terminates this download thread. |
protected void |
threadFinished(java.lang.String errMsgStr)
Performs thread-finished operations (if terminate flag not set). |
protected void |
transferStream(java.io.InputStream inputStream,
java.io.OutputStream outputStream)
Transfers data from the input stream to the output stream. |
Methods inherited from class com.isti.util.IstiNotifyThread |
sleep |
Methods inherited from class com.isti.util.IstiThread |
clearThreadWaitNotifyFlag, isTerminated, nextThreadNum, notifyThread, start, terminate, waitForNotify, waitForNotify, waitForTerminate, waitForTerminate, wasStarted |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
long maxProgressVal
Constructor Detail |
public FileDownloader(java.lang.String fileNameStr, java.io.File outputDir, CallBackStringParam callBackObj, IstiDialogInterface dialogObj, ProgressIndicatorInterface progressBarObj, boolean unzipDownloadedFileFlag)
fileNameStr
- the installer file name string.outputDir
- the output directory.callBackObj
- if not null then a call-back object whose method
is called (after the download is complete) with a string parameter
containing null if successful or an error message if an error occurred.dialogObj
- the dialog object or null for none.progressBarObj
- the progress bar object or null for none.unzipDownloadedFileFlag
- true to unzip file after download (if
it is a ZIP file); false to not unzip file.public FileDownloader(java.lang.String fileNameStr, java.io.File outputDir, CallBackStringParam callBackObj, IstiDialogInterface dialogObj, ProgressIndicatorInterface progressBarObj)
fileNameStr
- the installer file name string.outputDir
- the output directory.callBackObj
- if not null then a call-back object whose method
is called (after the download is complete) with a string parameter
containing null if successful or an error message if an error occurred.dialogObj
- the dialog object or null for none.progressBarObj
- the progress bar object or null for none.Method Detail |
public void setCallBackObj(CallBackStringParam callBackObj)
callBackObj
- if not null then a call-back object whose method
is called (after the download is complete) with a string parameter
containing null if successful or an error message if an error occurred.public void run()
protected void closeStreams()
protected void transferStream(java.io.InputStream inputStream, java.io.OutputStream outputStream) throws java.io.IOException
inputStream
- the input stream.outputStream
- the output stream.
java.io.IOException
- if an I/O error occurs.protected void threadFinished(java.lang.String errMsgStr)
errMsgStr
- error message to be entered into the call-back
object, or null for none.protected void doThreadFinished(java.lang.String errMsgStr)
errMsgStr
- error message to be entered into the call-back
object, or null for none.public void terminate()
terminateThread
method instead.
terminate
in class IstiNotifyThread
terminateThread
public void terminateThread(java.lang.String msgStr)
msgStr
- message string given to call-back object.public void requestDialogFocus()
public boolean isDownloadDone()
public java.io.File getOutputFileObj()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |