// This method should be set as the init-method in the spring config
// init-method="loadParamFile" when using this Filter
public void loadParamFile() throws IOException
{
SeekableLineReaderFactory fact = null;
SeekableLineReaderIterator iter = null;
try {
fact = GeneralURIStreamFactory.createSeekableStreamFactory(paramFile, false);
iter = new SeekableLineReaderIterator(fact.get());
paramSet = new HashSet<String>();
while (iter.hasNext()) {
String param = iter.next();
param = param.trim();
if (param.isEmpty() || param.startsWith("#")) {
continue;
}
// Use only the first word, ignore the rest
int wordEnd = param.indexOf(delim);
if (wordEnd > 0) {
param = param.substring(0, wordEnd);
}
paramSet.add(param);
}
} finally {
if (iter != null) {
iter.close();
}
if (fact != null) {
fact.close();
}