Package org.spongepowered.api.resource
Interface ResourceManager
public interface ResourceManager
The resource manager is in charge of loading
Resources
.
Packs are stacked on top of each other, so they will override and replace resources in packs which are a lower priority.
-
Method Summary
Modifier and TypeMethodDescriptionFinds all theresource paths
from all namespaces with the given path prefix and matches the filterPredicate
.load
(ResourcePath path) Loads theresource
at the given path, or throws an exception if it doesn't exist.streamAll
(ResourcePath path) Loads all theresources
at the given path from all activepack contents
.
-
Method Details
-
load
Loads theresource
at the given path, or throws an exception if it doesn't exist.- Parameters:
path
- The path to the resource- Returns:
- The resource
- Throws:
IOException
- If the resource could not be readFileNotFoundException
- If the file does not exist
-
streamAll
Loads all theresources
at the given path from all activepack contents
.- Parameters:
path
- The path to the resource- Returns:
- The list of all resources at the path
- Throws:
IOException
- If a resource could not be readFileNotFoundException
- If there are no resources at the path
-
find
Finds all theresource paths
from all namespaces with the given path prefix and matches the filterPredicate
.- Parameters:
pathPrefix
- The prefix of the pathspathFilter
- The filter all paths must pass- Returns:
- The list of matching paths
-