org.jrabbit.base.data.loading
Class SystemLoader

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

public class SystemLoader
extends java.lang.Object
implements Loader

A convenience object for accessing file data. This specifically loads data from the local machine, most likely from within the java project itself.

Author:
Chris Molini

Field Summary
private  java.lang.String path
          The file reference.
 
Constructor Summary
SystemLoader(java.lang.String path)
          Creates a SystemLoader that will attempt to retrieve information from the specified location.
 
Method Summary
 java.io.File file()
          Uses a File object to reference the file.
 java.lang.String path()
          Accesses a String path to the file.
 java.io.InputStream stream()
          Accesses the file via 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

path

private java.lang.String path
The file reference. This is intended to be the reference within the top-level folder of the project.

Constructor Detail

SystemLoader

public SystemLoader(java.lang.String path)
Creates a SystemLoader that will attempt to retrieve information from the specified location.

Parameters:
path - The file location (from the top-level folder of the project).
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 via 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 file.

file

public java.io.File file()
Uses a File object to reference the file.

Specified by:
file in interface Loader
Returns:
A File object describing the file.

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.