org.apache.lucene.analysis.util
Interface ResourceLoader


public interface ResourceLoader

Abstraction for loading resources (streams, files, and classes).


Method Summary
 List<String> getLines(String resource)
          Accesses a resource by name and returns the (non comment) lines containing data.
<T> T
newInstance(String cname, Class<T> expectedType, String... subpackages)
           
 InputStream openResource(String resource)
           
 

Method Detail

openResource

InputStream openResource(String resource)
                         throws IOException
Throws:
IOException

getLines

List<String> getLines(String resource)
                      throws IOException
Accesses a resource by name and returns the (non comment) lines containing data.

A comment line is any line that starts with the character "#"

Parameters:
resource -
Returns:
a list of non-blank non-comment lines with whitespace trimmed from front and back.
Throws:
IOException

newInstance

<T> T newInstance(String cname,
                  Class<T> expectedType,
                  String... subpackages)


Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.