Package org.apache.commons.discovery
Class Resource
java.lang.Object
org.apache.commons.discovery.Resource
- Direct Known Subclasses:
ResourceClass
'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.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionResource
(String resourceName, URL resource, ClassLoader loader) Create a newResource
instance. -
Method Summary
Modifier and TypeMethodDescriptionGet the value of loader.getName()
Get the value of resourceName.Get the value of URL.Get the value of URL.static Resource[]
toArray
(ResourceIterator iterator) Returns an array containing all of the elements in thisResourceIterator
in proper sequence.toString()
-
Field Details
-
name
-
resource
-
loader
-
-
Constructor Details
-
Resource
Create a newResource
instance.- Parameters:
resourceName
- The resource name has to be locatedresource
- The resource URL has to be locatedloader
- The class loader used to locate the given resource
-
-
Method Details
-
getName
Get the value of resourceName.- Returns:
- value of resourceName.
-
getResource
Get the value of URL.- Returns:
- value of URL.
-
getResourceAsStream
Get the value of URL.- Returns:
- value of URL.
-
getClassLoader
Get the value of loader.- Returns:
- value of loader.
-
toString
-
toArray
Returns an array containing all of the elements in thisResourceIterator
in proper sequence.- Parameters:
iterator
- TheResourceIterator
containing the- Returns:
- An array containing the elements of the given
ResourceIterator
-