Package io.kjson.resource
Class Resource
-
- All Implemented Interfaces:
public class Resource<T extends Object>A resource, as described by a URL and loaded by a ResourceLoader.
Peter Wall
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classResource.Companion
-
Field Summary
Fields Modifier and Type Field Description private final URLurlprivate final BooleanisDirectorypublic final static Resource.CompanionCompanion
-
Constructor Summary
Constructors Constructor Description Resource(URL url, Boolean isDirectory, ResourceLoader<T> resourceLoader)
-
Method Summary
Modifier and Type Method Description final URLgetUrl()final BooleanisDirectory()Tload()Load the resource. Resource<T>resolve(String relativeURL)Resolve a relative URL against the current Resource, returning a newResource.ResourceDescriptoropen()Open a Resource for reading. Booleanequals(Object other)IntegerhashCode()StringtoString()-
-
Constructor Detail
-
Resource
Resource(URL url, Boolean isDirectory, ResourceLoader<T> resourceLoader)
-
-
Method Detail
-
isDirectory
final Boolean isDirectory()
-
load
T load()
Load the resource. This function is delegated to the ResourceLoader, which will load a resource of the target type.
-
resolve
Resource<T> resolve(String relativeURL)
Resolve a relative URL against the current
Resource, returning a newResource.
-
open
ResourceDescriptor open()
Open a Resource for reading. The result of this function is a ResourceDescriptor, which contains an open
InputStreamand all the metadata known about the resource.
-
-
-
-