de.lessvoid.nifty.tools.resourceloader
Class NiftyResourceLoader

java.lang.Object
  extended by de.lessvoid.nifty.tools.resourceloader.NiftyResourceLoader

public class NiftyResourceLoader
extends Object

A simple wrapper around resource loading should anyone decide to change their minds how this is meant to work in the future.

Author:
Kevin Glass

Constructor Summary
NiftyResourceLoader()
           
 
Method Summary
 void addResourceLocation(ResourceLocation location)
          Add a location that will be searched for resources
 URL getResource(String ref)
          Get a resource as a URL
 InputStream getResourceAsStream(String ref)
          Get a resource
 void removeAllResourceLocations()
          Remove all the locations, no resources will be found until new locations have been added
 void removeResourceLocation(ResourceLocation location)
          Remove a location that will be no longer be searched for resources
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NiftyResourceLoader

public NiftyResourceLoader()
Method Detail

addResourceLocation

public void addResourceLocation(ResourceLocation location)
Add a location that will be searched for resources

Parameters:
location - The location that will be searched for resoruces

removeResourceLocation

public void removeResourceLocation(ResourceLocation location)
Remove a location that will be no longer be searched for resources

Parameters:
location - The location that will be removed from the search list

removeAllResourceLocations

public void removeAllResourceLocations()
Remove all the locations, no resources will be found until new locations have been added


getResourceAsStream

public InputStream getResourceAsStream(String ref)
Get a resource

Parameters:
ref - The reference to the resource to retrieve
Returns:
A stream from which the resource can be read

getResource

public URL getResource(String ref)
Get a resource as a URL

Parameters:
ref - The reference to the resource to retrieve
Returns:
A stream from which the resource can be read


Copyright © 2011. All Rights Reserved.