Package io.hekate.core.resource
Interface ResourceService
-
- All Superinterfaces:
Service
@DefaultServiceFactory(ResourceServiceFactory.class) public interface ResourceService extends Service
Resources loading service.Overview
This service provides an abstraction layer for accessing file system resources. Functionality of this service depends on the underlying runtime. In the simplest case, if
Hekate
node is directly constructed by the Java application then it will useURL
-based resources loading. Alternatively, ifHekate
node is managed by the Spring Framework then it will utilize the framework's resource loading capabilities.Accessing the Service
ResourceService
can be accessed viaHekate.get(Class)
method as in the example below:ResourceService resources = hekate.get(ResourceService.class);
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description InputStream
load(String path)
Loads a resource from the specified location.
-
-
-
Method Detail
-
load
InputStream load(String path) throws ResourceLoadException
Loads a resource from the specified location.- Parameters:
path
- Resource path.- Returns:
- Input stream.
- Throws:
ResourceLoadException
- Signals that resource couldn't be loaded.
-
-