- All Known Implementing Classes:
DefaultResourceManager
public interface ResourceManager
The ResourceManager API.
- Author:
- Manfred Riem ([email protected])
-
Method Summary
Modifier and Type Method Description void
addResource(Resource resource)
Add the resource.java.util.stream.Stream<java.lang.String>
getAllLocations()
Get all the locations for this resource manager.java.net.URL
getResource(java.lang.String location)
Get the resource.java.io.InputStream
getResourceAsStream(java.lang.String location)
Get the resource as a stream.java.util.Collection<java.net.URL>
getResources(java.lang.String location)
Get the resources.
-
Method Details
-
addResource
Add the resource.- Parameters:
resource
- the resource.
-
getResource
java.net.URL getResource(java.lang.String location) throws java.net.MalformedURLExceptionGet the resource.- Parameters:
location
- the location.- Returns:
- the URL.
- Throws:
java.net.MalformedURLException
- when the location is malformed.
-
getResources
java.util.Collection<java.net.URL> getResources(java.lang.String location) throws java.net.MalformedURLExceptionGet the resources.- Parameters:
location
- the location- Returns:
- the URLs.
- Throws:
java.net.MalformedURLException
- when the location is malformed.
-
getResourceAsStream
java.io.InputStream getResourceAsStream(java.lang.String location)Get the resource as a stream.- Parameters:
location
- the location.- Returns:
- the input stream, or null if not found.
-
getAllLocations
java.util.stream.Stream<java.lang.String> getAllLocations()Get all the locations for this resource manager.- Returns:
- all the locations for this resource manager.
-