|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
StateT - The type of object that maintains the state.public interface Downloader<StateT>
The interface to an object that manages the download of a single resource.
| Method Summary | |
|---|---|
void |
addListener(DownloaderListener<StateT> listener)
Adds a listener to be notified of events of this downloader. |
File |
getCompleteFile()
Returns the final path for the file. |
String |
getFinalName()
The final name for the file. |
File |
getIncompleteFile()
Returns the file to which this downloader downloads the resource. |
long |
getSize()
Returns the size of the resource that is downloaded by this downloader. |
long |
getStartTime()
Accessor the time the download started. |
StateT |
getState()
Returns the current state of this downloader. |
boolean |
isStarted()
Returns whether or not this downloader has already started. |
void |
pause()
Pauses the download. |
void |
removeListener(DownloaderListener<StateT> listener)
Removes a listener that was being notified of events of this downloader. |
void |
resume()
Resumes the download. |
void |
start()
Starts downloading the resource. |
void |
stop(boolean removeFiles)
Stops the download. |
void |
write(OutputStream os,
boolean cancelOnStreamClose)
Writes the resource that this downloader downloads to a given stream. |
| Method Detail |
|---|
void start()
StateT getState()
File getIncompleteFile()
File getCompleteFile()
long getSize()
void write(OutputStream os,
boolean cancelOnStreamClose)
os - The output stream to which to write the resource.cancelOnStreamClose - Whether or not the cancel the download
when the stream closes.void addListener(DownloaderListener<StateT> listener)
listener - The listener to be notified.void removeListener(DownloaderListener<StateT> listener)
listener - The listener to remove.boolean isStarted()
true if this downloader has already started,
otherwise false.String getFinalName()
void stop(boolean removeFiles)
removeFiles - Whether or not to also remove all downloaded files.void pause()
void resume()
long getStartTime()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||