Package org.apache.commons.io

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


      while (iterator.hasNext()) {
        String line = iterator.nextLine();

        if ("<key>CFBundleShortVersionString</key>".equals(line.trim())) {
          String versionLine = iterator.nextLine();

          version = versionLine.trim().replaceAll("</?string>", "");

          break;
        }
View Full Code Here


            int totalSize = 0; //总大小

            final List<ExcelData> dataList = Lists.newArrayList();

            if (iterator.hasNext()) {
                iterator.nextLine();//跳过第一行标题
            }

            while (iterator.hasNext()) {

                totalSize++;
View Full Code Here

            while (iterator.hasNext()) {

                totalSize++;

                String line = iterator.nextLine();
                String[] dataArray = StringUtils.split(line, separator);

                ExcelData data = new ExcelData();
                data.setId(Long.valueOf(dataArray[0]));
                data.setContent(dataArray[1]);
View Full Code Here

        LineIterator it = IOUtils.lineIterator(in, RDFFormat.RDFXML.getCharset());
        try {
            while(it.hasNext()) {
                lineNumber++;

                String line = it.nextLine();
                if(lineNumber % 2 == 0) {
                    // only odd line numbers contain triples
                    StringReader buffer = new StringReader(line);
                    lineParser.parse(buffer, baseURI);
                }
View Full Code Here

        LineIterator it = IOUtils.lineIterator(reader);
        try {
            while(it.hasNext()) {
                lineNumber++;

                String line = it.nextLine();
                if(lineNumber % 2 == 1) {
                    // only odd line numbers contain triples
                    StringReader buffer = new StringReader(line);
                    lineParser.parse(buffer, baseURI);
                }
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

        Map<String,String> map = new HashMap<String,String>();
        InputStream inStream = getClass().getResourceAsStream(
                "/org/archive/crawler/migrate/H1toH3.map");
        LineIterator iter = IOUtils.lineIterator(inStream, "UTF-8");
        while(iter.hasNext()) {
            String[] fields = iter.nextLine().split("\\|");
            map.put(fields[1], fields[0]);
        }
        inStream.close();
        return map;
    }
View Full Code Here

      // We want to grab the files called .out
      if (file.getName().contains(".out") && file.isFile() && file.canRead()) {
        LineIterator it = FileUtils.lineIterator(file, Constants.UTF8.name());
        try {
          while (it.hasNext()) {
            String line = it.nextLine();
            if (line.matches(".* \\[" + AuditedSecurityOperation.AUDITLOG + "\\s*\\].*")) {
              // Only include the message if startTimestamp is null. or the message occurred after the startTimestamp value
              if ((lastAuditTimestamp == null) || (line.substring(0, 23).compareTo(lastAuditTimestamp) > 0))
                result.add(line);
            }
View Full Code Here

    // Just grab the first rf file, it will do for now.
    String filePrefix = "file:";
    try {
      while (it.hasNext() && importFile == null) {
        String line = it.nextLine();
        if (line.matches(".*\\.rf")) {
          importFile = new File(line.replaceFirst(filePrefix, ""));
        }
      }
    } finally {
View Full Code Here

      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

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.