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

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

public class FileRetriever
extends java.lang.Object
implements DataRetriever

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

Author:
olli

Field Summary
 
Fields inherited from interface de.phleisch.app.itsucks.io.DataRetriever
NOTIFICATION_PROGRESS
 
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 getBytesSkipped()
          Returns the skipped bytes.
 long getContentLenght()
          Returns the content length in bytes.
 java.io.InputStream getDataAsInputStream()
          Returns an input stream for the retrieved data.
 Metadata getMetadata()
          Returns the metadata of the data source connection.
 boolean isConnected()
          Returns true if the retriever is connected.
 boolean isDataAvailable()
          Returns true if the data source contains any data to be read.
 void setBytesToSkip(long pBytesToSkip)
          Skip the given bytes (seek) when reading the data source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileRetriever

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

abort

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

Specified by:
abort in interface DataRetriever

connect

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

Specified by:
connect in interface DataRetriever
Throws:
java.io.IOException

isConnected

public boolean isConnected()
                    throws java.io.IOException
Description copied from interface: DataRetriever
Returns true if the retriever is connected.

Specified by:
isConnected in interface DataRetriever
Throws:
java.io.IOException

disconnect

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

Specified by:
disconnect in interface DataRetriever
Throws:
java.io.IOException

getMetadata

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

Specified by:
getMetadata in interface DataRetriever
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.

Specified by:
isDataAvailable in interface DataRetriever
Returns:
Throws:
java.io.IOException

getDataAsInputStream

public java.io.InputStream getDataAsInputStream()
Description copied from interface: DataRetriever
Returns an input stream for the retrieved data.

Specified by:
getDataAsInputStream in interface DataRetriever
Returns:

setBytesToSkip

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

Specified by:
setBytesToSkip in interface DataRetriever

getBytesSkipped

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

Specified by:
getBytesSkipped in interface DataRetriever
Returns:

getContentLenght

public long getContentLenght()
Description copied from interface: DataRetriever
Returns the content length in bytes.

Specified by:
getContentLenght in interface DataRetriever
Returns:


Copyright © 2010. All Rights Reserved.