org.gmetrics.util.io
Class ClassPathResource

java.lang.Object
  extended by org.gmetrics.util.io.ClassPathResource
All Implemented Interfaces:
groovy.lang.GroovyObject, Resource

public class ClassPathResource
extends java.lang.Object
implements groovy.lang.GroovyObject, Resource

A Resource implementation for resources available on the classpath.

This class also provides a static InputStream getInputStream(String path) convenience method.

This is an internal class and its API is subject to change.

Version:
$Revision: 24 $ - $Date: 2009-12-10 21:17:05 -0500 (Thu, 10 Dec 2009) $
Author:
Chris Mair

Constructor Summary
ClassPathResource(java.lang.String path)
          Construct a new ClassPathResource
 
Method Summary
 java.io.InputStream getInputStream()
          Open an InputStream on the classpath resource path
static java.io.InputStream getInputStream(java.lang.String path)
          Convenience method to open an InputStream on the specified resource path relative the classpath
 groovy.lang.MetaClass getMetaClass()
           
 java.lang.String getPath()
           
 java.lang.Object getProperty(java.lang.String name)
           
 java.lang.Object invokeMethod(java.lang.String name, java.lang.Object args)
           
 void setMetaClass(groovy.lang.MetaClass metaClass)
           
 void setProperty(java.lang.String name, java.lang.Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassPathResource

public ClassPathResource(java.lang.String path)
Construct a new ClassPathResource

Method Detail

getPath

public final java.lang.String getPath()

getInputStream

public static java.io.InputStream getInputStream(java.lang.String path)
                                          throws java.io.IOException
Convenience method to open an InputStream on the specified resource path relative the classpath

Throws:
java.io.IOException - - if an error occurs opening the InputStream

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Open an InputStream on the classpath resource path

Specified by:
getInputStream in interface Resource
Throws:
java.io.IOException - - if an error occurs opening the InputStream

getMetaClass

public groovy.lang.MetaClass getMetaClass()
Specified by:
getMetaClass in interface groovy.lang.GroovyObject

setMetaClass

public void setMetaClass(groovy.lang.MetaClass metaClass)
Specified by:
setMetaClass in interface groovy.lang.GroovyObject

invokeMethod

public java.lang.Object invokeMethod(java.lang.String name,
                                     java.lang.Object args)
Specified by:
invokeMethod in interface groovy.lang.GroovyObject

getProperty

public java.lang.Object getProperty(java.lang.String name)
Specified by:
getProperty in interface groovy.lang.GroovyObject

setProperty

public void setProperty(java.lang.String name,
                        java.lang.Object value)
Specified by:
setProperty in interface groovy.lang.GroovyObject


Copyright © 2010. All Rights Reserved.