Examples of SeekableLineReaderFactory


Examples of org.archive.util.binsearch.SeekableLineReaderFactory

 
  // 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();
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.