util
Class Resource

java.lang.Object
  extended by util.Resource

public class Resource
extends java.lang.Object

This is a copy of MatsimResource.java (see matsim.org). It makes sure that resources can also be located within jar files, since it looks for resources in several places.

Author:
stefan schroeder

Constructor Summary
Resource()
           
 
Method Summary
static java.io.InputStream getAsInputStream(java.lang.String filename)
           
static java.net.URL getAsURL(java.lang.String filename)
          Returns URL from the relative path of a resource.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Resource

public Resource()
Method Detail

getAsURL

public static final java.net.URL getAsURL(java.lang.String filename)
Returns URL from the relative path of a resource.

Parameters:
filename -
Returns:

getAsInputStream

public static final java.io.InputStream getAsInputStream(java.lang.String filename)
Parameters:
filename - relative path from within the resource directory to a file to be loaded
Returns:
a Stream to the requested resource file, or null if no such file exists.