|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.lastbamboo.common.download.AbstractDownloader<Sha1DState<DsT>>
org.lastbamboo.common.download.DummySha1Downloader<DsT>
DsT - The state type of the delegate downloader.public final class DummySha1Downloader<DsT extends DownloaderState>
A downloader that checks the SHA-1 of a resource downloaded by a delegate downloader.
| Constructor Summary | |
|---|---|
DummySha1Downloader(Downloader<DsT> delegate,
long expectedSize)
Constructs a new downloader. |
|
| Method Summary | |
|---|---|
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. |
Sha1DState<DsT> |
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 |
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. |
| Methods inherited from class org.lastbamboo.common.download.AbstractDownloader |
|---|
addListener, fireStateChanged, getStartTime, removeListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.lastbamboo.common.download.Downloader |
|---|
addListener, getStartTime, removeListener |
| Constructor Detail |
|---|
public DummySha1Downloader(Downloader<DsT> delegate,
long expectedSize)
delegate - The delegate downloader.expectedSize - The expected size of the file.| Method Detail |
|---|
public File getIncompleteFile()
Downloader
getIncompleteFile in interface Downloader<Sha1DState<DsT extends DownloaderState>>public long getSize()
Downloader
getSize in interface Downloader<Sha1DState<DsT extends DownloaderState>>public Sha1DState<DsT> getState()
Downloader
getState in interface Downloader<Sha1DState<DsT extends DownloaderState>>public void start()
Downloader
start in interface Downloader<Sha1DState<DsT extends DownloaderState>>public void stop(boolean removeFiles)
Downloader
stop in interface Downloader<Sha1DState<DsT extends DownloaderState>>removeFiles - Whether or not to also remove all downloaded files.public void pause()
Downloader
pause in interface Downloader<Sha1DState<DsT extends DownloaderState>>public void resume()
Downloader
resume in interface Downloader<Sha1DState<DsT extends DownloaderState>>public boolean isStarted()
Downloader
isStarted in interface Downloader<Sha1DState<DsT extends DownloaderState>>true if this downloader has already started,
otherwise false.
public void write(OutputStream os,
boolean cancelOnStreamClose)
Downloader
write in interface Downloader<Sha1DState<DsT extends DownloaderState>>os - The output stream to which to write the resource.cancelOnStreamClose - Whether or not the cancel the download
when the stream closes.public String getFinalName()
Downloader
getFinalName in interface Downloader<Sha1DState<DsT extends DownloaderState>>public File getCompleteFile()
Downloader
getCompleteFile in interface Downloader<Sha1DState<DsT extends DownloaderState>>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||