public abstract class AbstractDownloadTask extends DefaultFuture<DownloadFuture> implements DownloadFuture, java.lang.Runnable
| Modifier and Type | Field and Description |
|---|---|
protected java.util.concurrent.ExecutorService |
executor |
protected java.lang.String |
url |
| Constructor and Description |
|---|
AbstractDownloadTask(java.lang.String url,
java.util.concurrent.ExecutorService executor) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract java.io.File |
download() |
java.io.File |
getFile()
Returns the file that has been downloaded on the local file system
|
java.lang.String |
getUrl()
Returns the original url
|
void |
run() |
void |
setException(java.io.IOException exception) |
void |
setFile(java.io.File file) |
addListener, await, await, await, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, cancel, getValue, isCanceled, isDone, removeListener, setValueclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcancel, isCanceledaddListener, await, await, await, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, isDone, removeListenerprotected final java.lang.String url
protected final java.util.concurrent.ExecutorService executor
public AbstractDownloadTask(java.lang.String url,
java.util.concurrent.ExecutorService executor)
public java.lang.String getUrl()
DownloadFuturegetUrl in interface DownloadFuturepublic java.io.File getFile()
throws java.io.IOException
DownloadFuturegetFile in interface DownloadFuturenull is the operation has
not completed yet or failedjava.io.IOExceptionpublic void setFile(java.io.File file)
public void setException(java.io.IOException exception)
public final void run()
run in interface java.lang.Runnableprotected abstract java.io.File download()
throws java.lang.Exception
java.lang.ExceptionCopyright © 2017 Red Hat. All Rights Reserved.