public class Resource extends Object
Modifier and Type | Field and Description |
---|---|
protected ClassLoader |
loader |
protected String |
name |
protected URL |
resource |
Constructor and Description |
---|
Resource(String resourceName,
URL resource,
ClassLoader loader)
Create a new
Resource instance. |
Modifier and Type | Method and Description |
---|---|
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)
Returns an array containing all of the elements in this
ResourceIterator in proper sequence. |
String |
toString() |
protected final String name
protected final URL resource
protected final ClassLoader loader
public Resource(String resourceName, URL resource, 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 String getName()
public URL getResource()
public InputStream getResourceAsStream()
public ClassLoader getClassLoader()
public static Resource[] toArray(ResourceIterator iterator)
ResourceIterator
in proper sequence.iterator
- The ResourceIterator
containing theResourceIterator
Copyright © 2002–2016 The Apache Software Foundation. All rights reserved.