data
Class DataResources

java.lang.Object
  extended by data.DataResources

public class DataResources
extends java.lang.Object

Gives access to resources. Use paths from the root of the project/classpath as this uses the ClassLoader (of the Resources class) to load the resource.

Author:
dcs0ah1

Constructor Summary
DataResources()
           
 
Method Summary
static java.net.URL getResource(java.lang.String resource)
          Get a resource (data, images, xml, ...) relative to the classloader/root of the project.
static java.io.InputStream getResourceAsStream(java.lang.String resource)
          Get a resource (data, images, xml, ...) relative to the classloader/root of the project.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataResources

public DataResources()
Method Detail

getResource

public static java.net.URL getResource(java.lang.String resource)
Get a resource (data, images, xml, ...) relative to the classloader/root of the project. Equivalent to Resources.class.getClassLoader().getResource()

Parameters:
resource - the resource
Returns:
the resource

getResourceAsStream

public static java.io.InputStream getResourceAsStream(java.lang.String resource)
Get a resource (data, images, xml, ...) relative to the classloader/root of the project. Equivalent to Resources.class.getClassLoader().getResourceAsStream()

Parameters:
resource - the resource
Returns:
the resource as stream