ca.infoway.messagebuilder.util.xml
Class ClasspathResource

Package class diagram package ClasspathResource
java.lang.Object
  extended by ca.infoway.messagebuilder.util.xml.ClasspathResource
All Implemented Interfaces:
InputStreamResource

public class ClasspathResource
extends Object
implements InputStreamResource

A class that makes it easy to read a resource on the classpath as an XML document.

Author:
Intelliware Development

Constructor Summary
ClasspathResource(Class<?> c, String resourceName)
          Standard constructor.
ClasspathResource(String resourceName)
          Standard constructor.
 
Method Summary
 InputStream getInputStream()
          Obtain the classpath resource as a stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClasspathResource

public ClasspathResource(String resourceName)

Standard constructor.

Using this constructor is equivalent to ClasspathResource.class.getClassLoader().getResourceAsStream(resourceName)

Parameters:
resourceName - - the resource name.

ClasspathResource

public ClasspathResource(Class<?> c,
                         String resourceName)

Standard constructor.

Using this constructor is equivalent to c.getResourceAsStream(resourceName)

Parameters:
c - - a class whose package helps identify the location of the resource name.
resourceName - - the resource name that can be found relative to the class, c
Method Detail

getInputStream

public InputStream getInputStream()

Obtain the classpath resource as a stream.

Specified by:
getInputStream in interface InputStreamResource
Returns:
- the stream


Copyright © 2013. All Rights Reserved.