Package: org.gmetrics.util.io

## [Groovy] Class ClassPathResource

- org.gmetrics.util.io.ClassPathResource

- All Implemented Interfaces and Traits:
    Resource

      class ClassPathResource

  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.
  Authors:
    Chris Mair
  Version:
    \$Revision: 24 \$ - \$Date: 2009-12-10 21:17:05 -0500 (Thu, 10 Dec 2009) \$

- - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `String` | `path`

  - ### Constructor Summary

    Constructors
    Constructor and description

    `ClassPathResource (String path)`
    Construct a new ClassPathResource
    path:
      - the path to the resource (file).

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---

    ``

    `static InputStream`

    `getInputStream(String path)`
    Convenience method to open an InputStream on the specified resource path relative the classpath
    path:
      - the path to the resource (file).

    `` | `InputStream` | `getInputStream()` Open an InputStream on the classpath resource path

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll`

- - ### Property Detail

    - #### final String path

  - ### Constructor Detail

    - #### ClassPathResource(String path)

      Construct a new ClassPathResource

      path:
        - the path to the resource (file). The path is relative to the classpath, by default, but may be optionally prefixed by any of the valid java.net.URL prefixes, such as "file:" (to load from a relative or absolute path on the filesystem), or "http:". The path must not be empty or null.

  - ### Method Detail

    - #### static InputStream getInputStream(String path)

      Convenience method to open an InputStream on the specified resource path relative the classpath

      path:
        - the path to the resource (file). The path is relative to the classpath, by default, but may be optionally prefixed by any of the valid java.net.URL prefixes, such as "file:" (to load from a relative or absolute path on the filesystem), or "http:". The path must not be empty or null.
      throws:
        IOException - if an error occurs opening the InputStream

    - #### InputStream getInputStream()

      Open an InputStream on the classpath resource path

      throws:
        IOException - if an error occurs opening the InputStream