Overview | Package | Class | Deprecated | Index | Help
| Griffon 0.9.5-rc2
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD

## griffon.core
[Java] Interface ResourceHandler

    public interface ResourceHandler

Indicates a type that knows how to load resources from the classpath.

Authors:
  Andres Almiray

Since:
  0.9.5

Method Summary
`InputStream` | `getResourceAsStream(String name)` Returns an input stream for reading the specified resource.
`URL` | `getResourceAsURL(String name)` Finds the resource with the given name.
`List` | `getResources(String name)` Finds all the resources with the given name.

Method Detail

### getResourceAsStream

    public InputStream getResourceAsStream(String name)

  Returns an input stream for reading the specified resource.
  Parameters:
    `name` - The resource name
  Returns:
    An input stream for reading the resource, or `null` if the resource could not be found

### getResourceAsURL

    public URL getResourceAsURL(String name)

  Finds the resource with the given name. A resource is some data (images, audio, text, etc) that can be accessed by class code in a way that is independent of the location of the code.

  The name of a resource is a '`/`'-separated path name that identifies the resource.

  Parameters:
    `name` - The resource name
  Returns:
    A `URL` object for reading the resource, or `null` if the resource could not be found.

### getResources

    public List getResources(String name)

  Finds all the resources with the given name. A resource is some data (images, audio, text, etc) that can be accessed by class code in a way that is independent of the location of the code.

  The name of a resource is a `/`-separated path name that identifies the resource.

  Parameters:
    `name` - The resource name
  Returns:
    An java.util.List of `URL` objects for the resource. If no resources could be found, the list will be empty. Resources that the class loader doesn't have access to will not be in the list.

Groovy Documentation