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, setValue
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
cancel, isCanceled
addListener, await, await, await, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, isDone, removeListener
protected 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()
DownloadFuture
getUrl
in interface DownloadFuture
public java.io.File getFile() throws java.io.IOException
DownloadFuture
getFile
in interface DownloadFuture
null
is the operation has
not completed yet or failedjava.io.IOException
public void setFile(java.io.File file)
public void setException(java.io.IOException exception)
public final void run()
run
in interface java.lang.Runnable
protected abstract java.io.File download() throws java.lang.Exception
java.lang.Exception
Copyright © 2014 Red Hat. All Rights Reserved.