|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.phleisch.app.itsucks.io.impl.FileResumeRetriever
public class FileResumeRetriever
This retriever is used to resume partial downloaded files. It creates an additional retriever, the file retriever, and combine it with the original data retriever. So it can send the complete data through the processing chain without receiving it completly from the data retriever.
| Field Summary | |
|---|---|
protected DataProcessorChain |
mDataProcessorChain
|
| Fields inherited from interface de.phleisch.app.itsucks.io.DataRetriever |
|---|
NOTIFICATION_PROGRESS, RESULT_RETRIEVAL_ABORTED, RESULT_RETRIEVAL_FAILED, RESULT_RETRIEVAL_FAILED_BUT_RETRYABLE, RESULT_RETRIEVAL_NOT_STARTED_YET, RESULT_RETRIEVAL_OK |
| Constructor Summary | |
|---|---|
FileResumeRetriever(DataRetriever pDataRetriever,
java.io.File pFile)
|
|
| Method Summary | |
|---|---|
void |
abort()
Aborts the current retrieving. |
void |
addObserver(java.util.Observer pO)
Adds an observer to the retriever, usable to retrieve progress change events. |
void |
connect()
Advise the Retriever to connect to the data source. |
void |
deleteObserver(java.util.Observer pO)
Deletes an registered observer. |
void |
disconnect()
Disconnect from the data source. |
long |
getBytesRetrieved()
Returns the count of bytes read from the data source. |
long |
getBytesSkipped()
Returns the skipped bytes. |
Context |
getContext()
Gets the context from this data retriever. |
DataConsumer |
getDataConsumer()
|
DataProcessorChain |
getDataProcessorChain()
|
Metadata |
getMetadata()
Returns the metadata of the data source connection. |
float |
getProgress()
Returns the progress in processing the data in percent. |
int |
getResultCode()
Returns the internal state and result code. |
java.net.URL |
getUrl()
Returns the URL which is retrieved. |
boolean |
isDataAvailable()
Returns true if the data source contains any data to be read. |
void |
retrieve()
Retrieves all available data and send it through the processor chain. |
void |
setBytesToSkip(long pBytesToSkip)
Skip the given bytes (seek) when reading the data source. |
void |
setContext(Context pContext)
Sets the context for this data retriever. |
void |
setDataConsumer(DataConsumer pDataConsumer)
|
void |
setDataProcessorChain(DataProcessorChain pDataProcessorChain)
|
void |
setUrl(java.net.URL pUrl)
Sets the URL to be retrieved. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected DataProcessorChain mDataProcessorChain
| Constructor Detail |
|---|
public FileResumeRetriever(DataRetriever pDataRetriever,
java.io.File pFile)
| Method Detail |
|---|
public void abort()
DataRetriever
abort in interface DataRetriever
public void connect()
throws java.io.IOException
DataRetriever
connect in interface DataRetrieverjava.io.IOException
public void retrieve()
throws java.io.IOException
DataRetriever
retrieve in interface DataRetrieverjava.io.IOException
public void disconnect()
throws java.io.IOException
DataRetriever
disconnect in interface DataRetrieverjava.io.IOExceptionpublic long getBytesRetrieved()
DataRetriever
getBytesRetrieved in interface DataRetrieverpublic Metadata getMetadata()
DataRetriever
getMetadata in interface DataRetrieverpublic float getProgress()
DataRetriever
getProgress in interface DataRetrieverpublic void setUrl(java.net.URL pUrl)
DataRetriever
setUrl in interface DataRetrieverpublic java.net.URL getUrl()
DataRetriever
getUrl in interface DataRetriever
public boolean isDataAvailable()
throws java.io.IOException
DataRetriever
isDataAvailable in interface DataRetrieverjava.io.IOExceptionpublic DataConsumer getDataConsumer()
getDataConsumer in interface DataRetrieverpublic void setDataConsumer(DataConsumer pDataConsumer)
setDataConsumer in interface DataRetrieverpublic void addObserver(java.util.Observer pO)
DataRetrieverNOTIFICATION_PROGRESS will be sent when the progress is updated.
addObserver in interface DataRetrieverpublic void deleteObserver(java.util.Observer pO)
DataRetriever
deleteObserver in interface DataRetrieverpublic void setBytesToSkip(long pBytesToSkip)
DataRetriever
setBytesToSkip in interface DataRetrieverpublic long getBytesSkipped()
DataRetriever
getBytesSkipped in interface DataRetrieverpublic int getResultCode()
DataRetriever
getResultCode in interface DataRetrieverpublic Context getContext()
DataRetriever
getContext in interface DataRetrieverpublic void setContext(Context pContext)
DataRetriever
setContext in interface DataRetrieverpublic DataProcessorChain getDataProcessorChain()
public void setDataProcessorChain(DataProcessorChain pDataProcessorChain)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||