Package org.jesterj.ingest.utils
Class ClassSubPathResourceLoader
- java.lang.Object
-
- org.jesterj.ingest.utils.ClassSubPathResourceLoader
-
- All Implemented Interfaces:
org.apache.lucene.util.ResourceLoader
public class ClassSubPathResourceLoader extends java.lang.Object implements org.apache.lucene.util.ResourceLoader
-
-
Constructor Summary
Constructors Constructor Description ClassSubPathResourceLoader(java.lang.ClassLoader loader, java.lang.String subpath)Creates an instance using the given classloader to load Resources and classes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> java.lang.Class<? extends T>findClass(java.lang.String cname, java.lang.Class<T> expectedType)<T> TnewInstance(java.lang.String cname, java.lang.Class<T> expectedType)java.io.InputStreamopenResource(java.lang.String resource)
-
-
-
Constructor Detail
-
ClassSubPathResourceLoader
public ClassSubPathResourceLoader(java.lang.ClassLoader loader, java.lang.String subpath)Creates an instance using the given classloader to load Resources and classes. Resource loading will be restricted to a portion of the classpath determined by prepending the specified sub-path. Class find/load still uses the full classpath.- Parameters:
loader- the class loader to usesubpath- the subpath within the classpath to load resources from
-
-
Method Detail
-
openResource
public java.io.InputStream openResource(java.lang.String resource) throws java.io.IOException- Specified by:
openResourcein interfaceorg.apache.lucene.util.ResourceLoader- Throws:
java.io.IOException
-
findClass
public <T> java.lang.Class<? extends T> findClass(java.lang.String cname, java.lang.Class<T> expectedType)- Specified by:
findClassin interfaceorg.apache.lucene.util.ResourceLoader
-
newInstance
public <T> T newInstance(java.lang.String cname, java.lang.Class<T> expectedType)- Specified by:
newInstancein interfaceorg.apache.lucene.util.ResourceLoader
-
-