org.jrabbit.base.data.loading
Class FileLoader

java.lang.Object
  extended by org.jrabbit.base.data.loading.FileLoader
All Implemented Interfaces:
Loader

public class FileLoader
extends java.lang.Object
implements Loader

A convenience object for accessing data from a supplied File.

Author:
Chris Molini

Field Summary
protected  java.io.File file
          The File being accessed.
 
Constructor Summary
FileLoader(java.io.File file)
          Creates a FileLoader that accesses the supplied File.
FileLoader(java.lang.String filepath)
          Creates a FileLoader that accesses the File indicated by the supplied path.
 
Method Summary
 java.io.File file()
          Returns the File.
 java.lang.String path()
          Accesses a String path to the file.
 java.io.InputStream stream()
          Accesses the File's data via an InputStream.
 java.lang.String type()
          Returns the type of the File.
 java.net.URL url()
          Creates a URL to access the file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

file

protected java.io.File file
The File being accessed.

Constructor Detail

FileLoader

public FileLoader(java.lang.String filepath)
Creates a FileLoader that accesses the File indicated by the supplied path.

Parameters:
filepath - The path to the desired File.

FileLoader

public FileLoader(java.io.File file)
Creates a FileLoader that accesses the supplied File.

Parameters:
file - The File to retrieve data from.
Method Detail

path

public java.lang.String path()
Accesses a String path to the file.

Specified by:
path in interface Loader
Returns:
A String representation of the filepath.

stream

public java.io.InputStream stream()
Accesses the File's data via an InputStream.

Specified by:
stream in interface Loader
Returns:
An input stream of data from the file.

url

public java.net.URL url()
Creates a URL to access the file.

Specified by:
url in interface Loader
Returns:
A URL describing the location of the File.

file

public java.io.File file()
Returns the File.

Specified by:
file in interface Loader
Returns:
A reference to the file being accessed.

type

public java.lang.String type()
Returns the type of the File.

Specified by:
type in interface Loader
Returns:
The file type. NOTE: This returns in all caps.