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, waitcancel, download, getConfirmationMessage, loadUrlprivate 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()
DownloadTaskStrings with error messages or Exceptions.getErrorObjects in interface DownloadTaskpublic String acceptsDocumentationSummary()
DownloadTaskacceptsDocumentationSummary in interface DownloadTaskpublic boolean acceptsUrl(String url)
public boolean isSafeForRemotecontrolRequests()
public boolean acceptsUrl(String url, boolean isRemotecontrol)
DownloadTaskacceptsUrl in interface DownloadTaskurl - the url to download fromisRemotecontrol - True if download request comes from remotecontrol.public String getTitle()
DownloadTaskgetTitle in interface DownloadTaskpublic String[] getPatterns()
DownloadTaskgetPatterns in interface DownloadTask