org.wamblee.io
Class FileResource

java.lang.Object
  extended by org.wamblee.io.FileResource
All Implemented Interfaces:
InputResource

public class FileResource
extends java.lang.Object
implements InputResource

Resource implemention for reading from a file.

Author:
Erik Brakkee

Constructor Summary
FileResource(java.io.File aFile)
          Constructs the resource.
 
Method Summary
 java.io.InputStream getInputStream()
          Gets the input stream to the resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileResource

public FileResource(java.io.File aFile)
Constructs the resource.

Parameters:
aFile - File to read.
Method Detail

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Description copied from interface: InputResource
Gets the input stream to the resource. The obtained input stream must be closed once reading has finished.

Specified by:
getInputStream in interface InputResource
Returns:
Input stream to the resource, never null.
Throws:
java.io.IOException - in case the resource cannot be found.


Copyright © 2010. All Rights Reserved.