Package net.targetr.wtm3.io.loader
Class ClassPathResourceLoader
java.lang.Object
net.targetr.wtm3.io.loader.ClassPathResourceLoader
- All Implemented Interfaces:
ResourceLoader
Opens resources from the classpath using
Class.getResourceAsStream(String).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the resource source.openInputStream(String path) Opens a resource stream.
-
Constructor Details
-
ClassPathResourceLoader
public ClassPathResourceLoader()Creates a new ClassPathResourceLoader.
-
-
Method Details
-
openInputStream
Description copied from interface:ResourceLoaderOpens a resource stream. The caller is responsible for closing the returned stream.- Specified by:
openInputStreamin interfaceResourceLoader- Parameters:
path- the resource path understood by this loader- Returns:
- a stream containing the resource data, or null if the resource is not found
- Throws:
IOException- if opening or reading the resource fails
-
getSource
Description copied from interface:ResourceLoaderReturns the resource source.- Specified by:
getSourcein interfaceResourceLoader- Returns:
- a string representing the source resources are loaded from
-