Package org.apache.commons.io

Examples of org.apache.commons.io.LineIterator.nextLine()


      throw new IOException( "Resource \"" + RESOURCE_NAME_DE_PLZ_TXT + "\" not found" );
    }

    LineIterator iterator = IOUtils.lineIterator( resource.openStream(), "UTF-8" );
    while ( iterator.hasNext() ) {
      String line = iterator.nextLine();
      String[] parts = line.split( "\t" );
      if ( parts.length == 0 ) {
        continue;
      }
View Full Code Here


        // TODO how to enumerate bundle resources?
        final String list = getBenchmarkText("/LIST.txt");
        final LineIterator it = new LineIterator(new StringReader(list));
        final List<String> result = new LinkedList<String>();
        while(it.hasNext()) {
            result.add(getExampleBenchmarkPath(request, it.nextLine()));
        }
        return result;
    }

    /** Return example benchmark text from our class resources */
 
View Full Code Here

        nextPattern:
        for (String expr : regexp) {
            final Pattern p = Pattern.compile(".*" + expr + ".*");
            final LineIterator it = new LineIterator(new StringReader(contentString));
            while (it.hasNext()) {
                final String line = it.nextLine();
                if (expected & p.matcher(line).matches()) {
                    continue nextPattern;
                }
                if(!expected & p.matcher(line).matches()) {
                    fail(this + ": match found for regexp '" + expr + "', content=\n" + contentString);
View Full Code Here

     * @throws IOException
     */
    private void readPrefixMappings(InputStream in,boolean validate) throws IOException {
        LineIterator it = IOUtils.lineIterator(in, "UTF-8");
        while(it.hasNext()){
            String mapping = it.nextLine();
            if(mapping.charAt(0) != '#'){
                int sep = mapping.indexOf('\t');
                if(sep < 0 || mapping.length() <= sep+1){
                    log.warn("Illegal prefix mapping '{}'",mapping);
                } else {
View Full Code Here

     * @throws IOException
     */
    private void readPrefixMappings(InputStream in) throws IOException {
        LineIterator it = IOUtils.lineIterator(in, "UTF-8");
        while(it.hasNext()){
            String mapping = it.nextLine();
            if(mapping.charAt(0) != '#'){
                int sep = mapping.indexOf('\t');
                if(sep < 0 || mapping.length() <= sep+1){
                    log.warn("Illegal prefix mapping '{}'",mapping);
                } else {
View Full Code Here

            }
            final Pattern p = Pattern.compile(".*" + expr + ".*");
            reader = new InputStreamReader(blob.getStream(), charset);
            final LineIterator it = new LineIterator(reader);
            while (it.hasNext()) {
                final String line = it.nextLine();
                if (p.matcher(line).matches()) {
                    continue nextPattern;
                }
            }
            fail(this + ": no match for regexp '" + expr + "', content=\n" +
View Full Code Here

    public List<String> getLines(String resource) throws IOException {
        List<String> lines = new ArrayList<String>();
        LineIterator it = IOUtils.lineIterator(openResource(resource), "UTF-8");
        while(it.hasNext()){
            String line = it.nextLine();
            if(line != null && !line.isEmpty() && line.charAt(0) != '#'){
                lines.add(line);
            }
        }
        return lines;
View Full Code Here

    public List<String> getLines(String resource) throws IOException {
        List<String> lines = new ArrayList<String>();
        LineIterator it = IOUtils.lineIterator(openResource(resource), "UTF-8");
        while(it.hasNext()){
            String line = it.nextLine();
            if(line != null && !line.isEmpty() && line.charAt(0) != '#'){
                lines.add(line);
            }
        }
        return lines;
View Full Code Here

        while (iter.hasNext()) {
          lineNo++;
         
          if (minLinesPerEntry == 1) {
            // Simple case
            line = iter.nextLine();
          } else {
            String s = iter.nextLine();
            if (moreLinesToCome == 0) {
              Matcher m = getInternalPatternFirstLine().matcher(s);
              if (m.find()) {
View Full Code Here

         
          if (minLinesPerEntry == 1) {
            // Simple case
            line = iter.nextLine();
          } else {
            String s = iter.nextLine();
            if (moreLinesToCome == 0) {
              Matcher m = getInternalPatternFirstLine().matcher(s);
              if (m.find()) {
                // First line
                line = s;
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.