org.apache.commons.discovery

Class Resource

Known Direct Subclasses:
ResourceClass

public class Resource
extends java.lang.Object

'Resource' located by discovery. Naming of methods becomes a real pain ('getClass()') so I've patterned this after ClassLoader... I think it works well as it will give users a point-of-reference.
Authors:
Craig R. McClanahan
Costin Manolache
Richard A. Sitze

Field Summary

protected ClassLoader
loader
protected String
name
protected URL
resource

Constructor Summary

Resource(String resourceName, URL resource, ClassLoader loader)

Method Summary

ClassLoader
getClassLoader()
Get the value of loader.
String
getName()
Get the value of resourceName.
URL
getResource()
Get the value of URL.
InputStream
getResourceAsStream()
Get the value of URL.
static Resource[]
toArray(ResourceIterator iterator)
String
toString()

Field Details

loader

protected final ClassLoader loader

name

protected final String name

resource

protected final URL resource

Constructor Details

Resource

public Resource(String resourceName,
                URL resource,
                ClassLoader loader)

Method Details

getClassLoader

public ClassLoader getClassLoader()
Get the value of loader.
Returns:
value of loader.

getName

public String getName()
Get the value of resourceName.
Returns:
value of resourceName.

getResource

public URL getResource()
Get the value of URL.
Returns:
value of URL.

getResourceAsStream

public InputStream getResourceAsStream()
Get the value of URL.
Returns:
value of URL.

toArray

public static Resource[] toArray(ResourceIterator iterator)

toString

public String toString()

Copyright (c) 2002 - Apache Software Foundation