Package org.apache.commons.io

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


          // Error handling
          lineNo++;
          List<IStatus> statuses = null;
          boolean fatal = false; // determines whether to interrupt parsing
         
          String line = iter.nextLine();
          Matcher m = getInternalPattern().matcher(line);
          if (m.find()) {
            // The next line matches, so flush the previous entry and continue
            if (currentEntry != null) {
              collector.collect(currentEntry);
View Full Code Here


      lineIterator = FileUtils.lineIterator(fileToCount);

      while (lineIterator.hasNext()) {
        // All work including special character handling done at worker
        // level
        String line = lineIterator.nextLine();
        // key is just the file name - initial mapping is easy
        // hard part comes with partitioning and reduction
        // we assume that we have unique file names in the dir
        MapWork newWork = new MapWork(fileToCount.getName(), line);
View Full Code Here

            String fileName = item.getName();
            if (fileName.length()>0){
              try {
                LineIterator it =  IOUtils.lineIterator(in, "UTF-8");
                while (it.hasNext()) {
                  String line = it.nextLine();
 
                  PersistenceManager pm = PMF.get().getPersistenceManager();
                  try  {
                    pm.makePersistent(processMessage(line));
                    messageCount ++;
View Full Code Here

    @Override
    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

    @Override
    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

     * @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

    try {
      it = IOUtils.lineIterator(inputStream, "UTF-8");

      while (it.hasNext()) {
        String line = it.nextLine();
        LOGGER.debug(line);
        if (filtered) {
          filtered = filter(line);
        }
      }
View Full Code Here

    String line;
    try {
      LineIterator it = FileUtils.lineIterator(new File(filename));
      try {
        while (it.hasNext()) {
          line = it.nextLine().trim();
          if (line.isEmpty() || line.startsWith("#")) {
            // continue
          } else if (line.equals("EXCLUDE")) {
            filter = excludes;
          } else if (line.equals("OPTIONS")) {
View Full Code Here

    LineIterator it = null;
    try {
      it = IOUtils.lineIterator(inputStream, "UTF-8");

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

        if (line.length() > 0) {
          addLine(line);
        }
View Full Code Here

    try {
      iterator = FileUtils.lineIterator(versionFile, null);

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

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

          version = versionLine.trim().replaceAll("</?string>", "");
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.