|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.phleisch.app.itsucks.job.impl.AbstractJob
de.phleisch.app.itsucks.job.download.impl.UrlDownloadJob
public class UrlDownloadJob
This is the implementation of a job for downloading files. It contains a URL to the file or directory to be downloaded.
| Field Summary | |
|---|---|
static java.lang.String |
JOB_PARAMETER_SKIP_DOWNLOADED_FILE
|
static java.lang.String |
JOB_PROGRESS_PROPERTY
Constant used to determine when the progress property has changed. |
| Fields inherited from class de.phleisch.app.itsucks.job.impl.AbstractJob |
|---|
mContext, mJobManager |
| Fields inherited from interface de.phleisch.app.itsucks.job.Job |
|---|
JOB_PRIORITY_PROPERTY, JOB_STATE_PROPERTY, MAX_PRIORITY, MIN_PRIORITY, STATE_ALREADY_PROCESSED, STATE_ASSIGNED, STATE_CLOSED, STATE_ERROR, STATE_FAILED, STATE_FINISHED, STATE_IGNORED, STATE_IN_PROGRESS, STATE_OPEN |
| Constructor Summary | |
|---|---|
UrlDownloadJob()
|
|
| Method Summary | |
|---|---|
void |
abort()
Aborts the job when running. |
UrlDownloadJob |
clone()
|
protected void |
download()
|
protected void |
executeDownload()
|
long |
getBytesDownloaded()
Returns the count of bytes which are downloaded |
DataRetriever |
getDataRetriever()
|
int |
getDepth()
Gets the recursive depth of the job. |
int |
getMaxRetryCount()
Returns the maximum count of retries when an retryable error occurs. |
Metadata |
getMetadata()
Gets the metadata of the data retriever. |
long |
getMinTimeBetweenRetry()
Gets the waiting time between two retries. |
Job |
getParent()
|
float |
getProgress()
Returns the current download progress. |
java.io.File |
getSavePath()
Returns the base save path for saving downloaded files. |
java.net.URL |
getUrl()
Gets the URL to be downloaded. |
boolean |
isSaveToDisk()
|
void |
run()
Starts the execution of the job. |
void |
setDataProcessorManager(DataProcessorManager pDataProcessorManager)
Sets the data processor manager. |
void |
setDataRetrieverManager(DataRetrieverManager pDataRetrieverManager)
Sets the data retriever manager. |
void |
setDepth(int pDepth)
Sets the recursive depth of the job. |
void |
setMaxRetryCount(int pMaxRetryCount)
Sets the maximum count of retries when an retryable error occurs. |
void |
setMinTimeBetweenRetry(long pMinTimeBetweenRetry)
Sets the waiting time between two retries. |
void |
setParent(UrlDownloadJob pParent)
Sets the parent of the job. |
void |
setSavePath(java.io.File pSavePath)
Sets the base save path for saving downloaded files. |
void |
setSaveToDisk(boolean pSaveToDisk)
Sets if this file should be saved as file. |
void |
setUrl(java.net.URL pUrl)
Sets the url to be downloaded. |
java.lang.String |
toString()
|
| Methods inherited from class de.phleisch.app.itsucks.job.impl.AbstractJob |
|---|
addParameter, addPropertyChangeListener, firePropertyChange, getContext, getId, getJobManager, getName, getParameter, getParameterList, getPriority, getState, hashCode, isClosed, isIgnoreFilter, removePropertyChangeListener, setContext, setId, setIgnoreFilter, setJobManager, setName, setPriority, setState |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface de.phleisch.app.itsucks.job.Job |
|---|
addParameter, addPropertyChangeListener, getContext, getId, getJobManager, getName, getParameter, getParameterList, getPriority, getState, isClosed, isIgnoreFilter, removePropertyChangeListener, setContext, setId, setIgnoreFilter, setJobManager, setName, setPriority, setState |
| Field Detail |
|---|
public static final java.lang.String JOB_PROGRESS_PROPERTY
getProgress(),
AbstractJob.addPropertyChangeListener(java.beans.PropertyChangeListener),
Constant Field Valuespublic static final java.lang.String JOB_PARAMETER_SKIP_DOWNLOADED_FILE
| Constructor Detail |
|---|
public UrlDownloadJob()
| Method Detail |
|---|
public void run()
throws java.lang.Exception
Job
run in interface Jobrun in class AbstractJobjava.lang.Exception
protected void download()
throws java.io.IOException
java.io.IOException
protected void executeDownload()
throws java.io.IOException
java.io.IOExceptionpublic void abort()
Job
abort in interface Jobabort in class AbstractJobpublic java.net.URL getUrl()
public void setUrl(java.net.URL pUrl)
pUrl - public void setDataRetrieverManager(DataRetrieverManager pDataRetrieverManager)
pDataRetrieverManager - public void setDataProcessorManager(DataProcessorManager pDataProcessorManager)
pDataProcessorManager - public int getDepth()
DownloadJob
getDepth in interface DownloadJobpublic void setDepth(int pDepth)
pDepth - public Job getParent()
public void setParent(UrlDownloadJob pParent)
pParent - public boolean isSaveToDisk()
isSaveToDisk in interface DownloadJobpublic void setSaveToDisk(boolean pSaveToDisk)
pSaveToFile - public java.io.File getSavePath()
DownloadJob
getSavePath in interface DownloadJobpublic void setSavePath(java.io.File pSavePath)
pSavePath - public DataRetriever getDataRetriever()
getDataRetriever in interface DownloadJobpublic float getProgress()
DownloadJob
getProgress in interface DownloadJobpublic int getMaxRetryCount()
DownloadJob
getMaxRetryCount in interface DownloadJobpublic void setMaxRetryCount(int pMaxRetryCount)
pMaxRetryCount - public long getMinTimeBetweenRetry()
DownloadJob
getMinTimeBetweenRetry in interface DownloadJobpublic void setMinTimeBetweenRetry(long pMinTimeBetweenRetry)
pMinTimeBetweenRetry - public long getBytesDownloaded()
DownloadJob
getBytesDownloaded in interface DownloadJobpublic Metadata getMetadata()
DownloadJob
getMetadata in interface DownloadJobpublic java.lang.String toString()
toString in class java.lang.Objectpublic UrlDownloadJob clone()
clone in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||