try {
File protectedWordFiles = new File( wordFiles );
if ( protectedWordFiles.exists() ) {
List<String> wlist = loader.getLines( wordFiles );
//This cast is safe in Lucene
protectedWords = new CharArraySet(
wlist, false
);//No need to go through StopFilter as before, since it just uses a List internally
}
else {
List<String> files = StrUtils.splitFileNames( wordFiles );
for ( String file : files ) {
List<String> wlist = loader.getLines( file.trim() );
if ( protectedWords == null ) {
protectedWords = new CharArraySet( wlist, false );
}
else {
protectedWords.addAll( wlist );
}
}