public class Resource
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.lang.ClassLoader |
loader |
protected java.lang.String |
name |
protected java.net.URL |
resource |
Constructor and Description |
---|
Resource(java.lang.String resourceName,
java.net.URL resource,
java.lang.ClassLoader loader)
Create a new
Resource instance. |
Modifier and Type | Method and Description |
---|---|
java.lang.ClassLoader |
getClassLoader()
Get the value of loader.
|
java.lang.String |
getName()
Get the value of resourceName.
|
java.net.URL |
getResource()
Get the value of URL.
|
java.io.InputStream |
getResourceAsStream()
Get the value of URL.
|
static Resource[] |
toArray(ResourceIterator iterator)
Returns an array containing all of the elements in this
ResourceIterator in proper sequence. |
java.lang.String |
toString() |
protected final java.lang.String name
protected final java.net.URL resource
protected final java.lang.ClassLoader loader
public Resource(java.lang.String resourceName, java.net.URL resource, java.lang.ClassLoader loader)
Resource
instance.resourceName
- The resource name has to be locatedresource
- The resource URL has to be locatedloader
- The class loader used to locate the given resourcepublic java.lang.String getName()
public java.net.URL getResource()
public java.io.InputStream getResourceAsStream()
public java.lang.ClassLoader getClassLoader()
public java.lang.String toString()
toString
in class java.lang.Object
public static Resource[] toArray(ResourceIterator iterator)
ResourceIterator
in proper sequence.iterator
- The ResourceIterator
containing theResourceIterator