|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.phleisch.app.itsucks.io.impl.FilterDataRetriever
de.phleisch.app.itsucks.io.http.impl.HttpFileResumeUrlRetriever
public class HttpFileResumeUrlRetriever
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. It can send the complete data through the processing chain without receiving it completly from the data retriever.
| Nested Class Summary | |
|---|---|
protected static class |
HttpFileResumeUrlRetriever.OperatingState
|
| Field Summary | |
|---|---|
protected java.io.File |
mLocalFile
|
protected HttpFileResumeUrlRetriever.OperatingState |
mOperatingState
|
protected long |
mResumeOffset
|
protected UrlDataRetriever |
mWrappedUrlDataRetriever
|
| Fields inherited from class de.phleisch.app.itsucks.io.impl.FilterDataRetriever |
|---|
mDataRetriever |
| Fields inherited from interface de.phleisch.app.itsucks.io.UrlDataRetriever |
|---|
RESULT_RETRIEVAL_ABORTED, RESULT_RETRIEVAL_FAILED, RESULT_RETRIEVAL_FAILED_BUT_RETRYABLE, RESULT_RETRIEVAL_NOT_STARTED_YET, RESULT_RETRIEVAL_OK, RESULT_RETRIEVAL_UNKNOWN |
| Fields inherited from interface de.phleisch.app.itsucks.io.DataRetriever |
|---|
NOTIFICATION_PROGRESS |
| Constructor Summary | |
|---|---|
HttpFileResumeUrlRetriever(UrlDataRetriever pDataRetriever,
java.io.File pFile)
|
|
| Method Summary | |
|---|---|
void |
abort()
Aborts the current retrieving. |
void |
connect()
Advise the Retriever to connect to the data source. |
void |
disconnect()
Disconnect from the data source. |
protected void |
doDelgateDownload()
|
protected void |
doReadOnlyFile(long bytesOnDisk)
|
protected void |
doResumeDownload(long bytesOnDisk)
|
HttpMetadata |
getMetadata()
Returns the metadata of the data source connection. |
int |
getResultCode()
Returns the internal state and result code after connecting. |
long |
getResumeOffset()
|
long |
getSuggestedTimeToWaitForRetry()
Returns the suggested time to wait befory retry the retrieval in ms. |
java.net.URL |
getUrl()
Returns the URL which is retrieved. |
boolean |
isConnected()
Returns true if the retriever is connected. |
void |
setUrl(java.net.URL pUrl)
Sets the URL to be retrieved. |
| Methods inherited from class de.phleisch.app.itsucks.io.impl.FilterDataRetriever |
|---|
getBytesSkipped, getContentLenght, getDataAsInputStream, isDataAvailable, setBytesToSkip |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface de.phleisch.app.itsucks.io.DataRetriever |
|---|
getBytesSkipped, getContentLenght, getDataAsInputStream, isDataAvailable, setBytesToSkip |
| Field Detail |
|---|
protected UrlDataRetriever mWrappedUrlDataRetriever
protected java.io.File mLocalFile
protected HttpFileResumeUrlRetriever.OperatingState mOperatingState
protected long mResumeOffset
| Constructor Detail |
|---|
public HttpFileResumeUrlRetriever(UrlDataRetriever pDataRetriever,
java.io.File pFile)
| Method Detail |
|---|
public void connect()
throws java.io.IOException
DataRetriever
connect in interface DataRetrieverconnect in class FilterDataRetrieverjava.io.IOException
protected void doResumeDownload(long bytesOnDisk)
throws java.io.IOException
java.io.IOException
protected void doReadOnlyFile(long bytesOnDisk)
throws java.io.IOException
java.io.IOException
protected void doDelgateDownload()
throws java.io.IOException
java.io.IOException
public void disconnect()
throws java.io.IOException
DataRetriever
disconnect in interface DataRetrieverdisconnect in class FilterDataRetrieverjava.io.IOExceptionpublic void abort()
DataRetriever
abort in interface DataRetrieverabort in class FilterDataRetrieverpublic long getResumeOffset()
getResumeOffset in interface ResumeUrlDataRetrieverpublic int getResultCode()
UrlDataRetriever
getResultCode in interface UrlDataRetrieverpublic long getSuggestedTimeToWaitForRetry()
UrlDataRetriever
getSuggestedTimeToWaitForRetry in interface UrlDataRetrieverpublic java.net.URL getUrl()
UrlDataRetriever
getUrl in interface UrlDataRetrieverpublic void setUrl(java.net.URL pUrl)
UrlDataRetriever
setUrl in interface UrlDataRetrieverpublic HttpMetadata getMetadata()
DataRetriever
getMetadata in interface DataRetrievergetMetadata in class FilterDataRetriever
public boolean isConnected()
throws java.io.IOException
DataRetriever
isConnected in interface DataRetrieverjava.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||