T
- The downloaded data typepublic abstract class AbstractDownloadTask<T> extends Object implements DownloadTask
Modifier and Type | Field and Description |
---|---|
private boolean |
canceled |
protected T |
downloadedData |
private List<Object> |
errorMessages |
private boolean |
failed |
Constructor and Description |
---|
AbstractDownloadTask() |
Modifier and Type | Method and Description |
---|---|
String |
acceptsDocumentationSummary()
Returns a short HTML documentation string, describing acceptable URLs.
|
boolean |
acceptsUrl(String url) |
boolean |
acceptsUrl(String url,
boolean isRemotecontrol)
Returns true if the task is able to open the given URL, false otherwise.
|
T |
getDownloadedData()
Replies the downloaded data.
|
List<Object> |
getErrorObjects()
Replies the error objects of the task.
|
String[] |
getPatterns()
Returns regular expressions that match the URLs
|
String |
getTitle()
Returns human-readable description of the task
|
boolean |
isCanceled() |
boolean |
isFailed() |
boolean |
isSafeForRemotecontrolRequests()
Check / decide if the task is safe for remotecontrol.
|
protected void |
rememberDownloadedData(T data) |
protected void |
rememberErrorMessage(String message) |
protected void |
rememberException(Exception exception) |
void |
setCanceled(boolean canceled) |
void |
setFailed(boolean failed) |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
cancel, download, getConfirmationMessage, loadUrl
private final List<Object> errorMessages
private boolean canceled
private boolean failed
protected T downloadedData
public AbstractDownloadTask()
public boolean isCanceled()
public void setCanceled(boolean canceled)
public boolean isFailed()
public void setFailed(boolean failed)
protected final void rememberErrorMessage(String message)
protected final void rememberException(Exception exception)
protected final void rememberDownloadedData(T data)
public final T getDownloadedData()
public List<Object> getErrorObjects()
DownloadTask
String
s with error messages or Exception
s.getErrorObjects
in interface DownloadTask
public String acceptsDocumentationSummary()
DownloadTask
acceptsDocumentationSummary
in interface DownloadTask
public boolean acceptsUrl(String url)
public boolean isSafeForRemotecontrolRequests()
public boolean acceptsUrl(String url, boolean isRemotecontrol)
DownloadTask
acceptsUrl
in interface DownloadTask
url
- the url to download fromisRemotecontrol
- True if download request comes from remotecontrol.public String getTitle()
DownloadTask
getTitle
in interface DownloadTask
public String[] getPatterns()
DownloadTask
getPatterns
in interface DownloadTask