Package org.ldaptive.io
Class ClasspathResourceLoader
- java.lang.Object
-
- org.ldaptive.io.ClasspathResourceLoader
-
- All Implemented Interfaces:
ResourceLoader
public class ClasspathResourceLoader extends Object implements ResourceLoader
Creates anInputStream
from a string that is prefixed with 'classpath:'. SeeClass.getResourceAsStream(String)
.
-
-
Constructor Summary
Constructors Constructor Description ClasspathResourceLoader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InputStream
load(String path)
Reads an input stream from a path.boolean
supports(String path)
Returns whether the supplied path can be loaded by this resource loader.
-
-
-
Field Detail
-
PREFIX
private static final String PREFIX
Prefix used to indicate a classpath resource.- See Also:
- Constant Field Values
-
-
Method Detail
-
supports
public boolean supports(String path)
Description copied from interface:ResourceLoader
Returns whether the supplied path can be loaded by this resource loader.- Specified by:
supports
in interfaceResourceLoader
- Parameters:
path
- to check- Returns:
- whether the supplied path can be loaded by this resource loader
-
load
public InputStream load(String path)
Description copied from interface:ResourceLoader
Reads an input stream from a path.- Specified by:
load
in interfaceResourceLoader
- Parameters:
path
- from which to read resource.- Returns:
- input stream.
-
-