Interface PackContents
- All Superinterfaces:
AutoCloseable,Nameable
Represents the container that stores
resources for retrieval.-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()booleanexists(PackType type, ResourcePath path) Tests if this pack contains an entry at the givenResourcePath.namespaces(PackType type) Gets thenamespacespertype.Finds all theResourcePaths in this pack matching the prefix and filter, and within the given depth.requireResource(PackType type, ResourcePath path) resource(PackType type, ResourcePath path)
-
Method Details
-
resource
Gets aresourcewithin apathpertype.If a resource is returned, be aware that is requires closing when you have finished working with the resource.
- Parameters:
type- The typepath- The domain named path- Returns:
- The resource
- Throws:
IOException
-
requireResource
Gets aresourcewithin apathpertype.Ensure that you close the resource once you have finished working with it!
- Parameters:
type- The typepath- The domain named path- Returns:
- The resource
- Throws:
IOException
-
paths
Collection<ResourcePath> paths(PackType type, String namespace, String prefix, Predicate<ResourceKey> filter) Finds all theResourcePaths in this pack matching the prefix and filter, and within the given depth.- Parameters:
type- The typenamespace- The namespace to searchprefix- The prefix of the pathfilter- The filter every path must match- Returns:
- A collection of matching paths
- See Also:
-
exists
Tests if this pack contains an entry at the givenResourcePath.- Parameters:
type- The typepath- The resource path- Returns:
- True if it exists, false if it does not
- See Also:
-
namespaces
Gets thenamespacespertype.- Parameters:
type- The type- Returns:
- The set of namespaces
-
close
void close()- Specified by:
closein interfaceAutoCloseable
-