de.lessvoid.nifty.tools.resourceloader
Class FileSystemLocation

java.lang.Object
  extended by de.lessvoid.nifty.tools.resourceloader.FileSystemLocation
All Implemented Interfaces:
ResourceLocation

public class FileSystemLocation
extends Object
implements ResourceLocation

A resource loading location that searches somewhere on the classpath

Author:
kevin

Constructor Summary
FileSystemLocation(File root)
          Create a new resoruce location based on the file system
 
Method Summary
 URL getResource(String ref)
          Get a resource as a URL
 InputStream getResourceAsStream(String ref)
          Get a resource as an input stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileSystemLocation

public FileSystemLocation(File root)
Create a new resoruce location based on the file system

Parameters:
root - The root of the file system to search
Method Detail

getResource

public URL getResource(String ref)
Description copied from interface: ResourceLocation
Get a resource as a URL

Specified by:
getResource in interface ResourceLocation
Parameters:
ref - The reference to the resource to retrieve
Returns:
A stream from which the resource can be read
See Also:
ResourceLocation.getResource(String)

getResourceAsStream

public InputStream getResourceAsStream(String ref)
Description copied from interface: ResourceLocation
Get a resource as an input stream

Specified by:
getResourceAsStream in interface ResourceLocation
Parameters:
ref - The reference to the resource to retrieve
Returns:
A stream from which the resource can be read or null if the resource can't be found in this location
See Also:
ResourceLocation.getResourceAsStream(String)


Copyright © 2011. All Rights Reserved.