public abstract class AbstractDownloadTask extends DefaultFuture<DownloadFuture> implements DownloadFuture, Runnable
Modifier and Type | Field and Description |
---|---|
protected ExecutorService |
executor |
protected String |
url |
Constructor and Description |
---|
AbstractDownloadTask(String url,
ExecutorService executor) |
Modifier and Type | Method and Description |
---|---|
protected abstract File |
download() |
File |
getFile()
Returns the file that has been downloaded on the local file system
|
String |
getUrl()
Returns the original url
|
void |
run() |
void |
setException(IOException exception) |
void |
setFile(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 String url
protected final ExecutorService executor
public AbstractDownloadTask(String url, ExecutorService executor)
public String getUrl()
DownloadFuture
getUrl
in interface DownloadFuture
public File getFile() throws IOException
DownloadFuture
getFile
in interface DownloadFuture
null
is the operation has
not completed yet or failedIOException
public void setFile(File file)
public void setException(IOException exception)
Copyright © 2011–2014 Red Hat. All rights reserved.