de.phleisch.app.itsucks.io.impl
Class FileRetriever

java.lang.Object
  extended by java.util.Observable
      extended by de.phleisch.app.itsucks.io.impl.AbstractDataRetriever
          extended by de.phleisch.app.itsucks.io.impl.FileRetriever
All Implemented Interfaces:
DataRetriever

public class FileRetriever
extends AbstractDataRetriever

Implementation of an data retriever which can read files from the filesystem.

Author:
olli

Field Summary
 
Fields inherited from class de.phleisch.app.itsucks.io.impl.AbstractDataRetriever
mContext, mDataConsumer, mUrl
 
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
FileRetriever(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.
 long getBytesRetrieved()
          Returns the count of bytes read from the data source.
 long getBytesSkipped()
          Returns the skipped bytes.
 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.
 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.
 
Methods inherited from class de.phleisch.app.itsucks.io.impl.AbstractDataRetriever
getContext, getDataConsumer, getUrl, setContext, setDataConsumer, setUrl
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
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
addObserver, deleteObserver
 

Constructor Detail

FileRetriever

public FileRetriever(java.io.File pFile)
Method Detail

abort

public void abort()
Description copied from interface: DataRetriever
Aborts the current retrieving.


connect

public void connect()
             throws java.io.IOException
Description copied from interface: DataRetriever
Advise the Retriever to connect to the data source.

Throws:
java.io.IOException

disconnect

public void disconnect()
                throws java.io.IOException
Description copied from interface: DataRetriever
Disconnect from the data source.

Throws:
java.io.IOException

getBytesRetrieved

public long getBytesRetrieved()
Description copied from interface: DataRetriever
Returns the count of bytes read from the data source.

Returns:

getMetadata

public Metadata getMetadata()
Description copied from interface: DataRetriever
Returns the metadata of the data source connection.

Returns:

getProgress

public float getProgress()
Description copied from interface: DataRetriever
Returns the progress in processing the data in percent.

Returns:

isDataAvailable

public boolean isDataAvailable()
                        throws java.io.IOException
Description copied from interface: DataRetriever
Returns true if the data source contains any data to be read.

Returns:
Throws:
java.io.IOException

retrieve

public void retrieve()
              throws java.io.IOException
Description copied from interface: DataRetriever
Retrieves all available data and send it through the processor chain.

Throws:
java.io.IOException

setBytesToSkip

public void setBytesToSkip(long pBytesToSkip)
Description copied from interface: DataRetriever
Skip the given bytes (seek) when reading the data source.


getBytesSkipped

public long getBytesSkipped()
Description copied from interface: DataRetriever
Returns the skipped bytes.

Returns:

getResultCode

public int getResultCode()
Description copied from interface: DataRetriever
Returns the internal state and result code. Check RESULT_RETRIEVAL_* constants for possible values.

Returns:


Copyright © 2008. All Rights Reserved.