Package java.util.regex

Examples of java.util.regex.Matcher.reset()


        commitFiles.addAll(commit.getFileNames());
        commitFiles.add(IndexFileNames.SEGMENTS_GEN);
        Matcher matcher = IndexFileNames.CODEC_FILE_PATTERN.matcher("");
        for (String file : dir.listAll()) {
          if (!commitFiles.contains(file)
              && (matcher.reset(file).matches() || file.startsWith(IndexFileNames.SEGMENTS))) {
            try {
              dir.deleteFile(file);
            } catch (Throwable t) {
              // suppress, it's just a best effort
            }
View Full Code Here


    }
   
    if (currentSegmentsFile != null) {
      Matcher m = IndexFileNames.CODEC_FILE_PATTERN.matcher("");
      for (String fileName : files) {
        m.reset(fileName);
        if (!fileName.endsWith("write.lock") && !fileName.equals(IndexFileNames.SEGMENTS_GEN)
            && (m.matches() || fileName.startsWith(IndexFileNames.SEGMENTS))) {
         
          // Add this file to refCounts with initial count 0:
          getRefCount(fileName);
View Full Code Here

    Matcher m = IndexFileNames.CODEC_FILE_PATTERN.matcher("");

    for(int i=0;i<files.length;i++) {
      String fileName = files[i];
      m.reset(fileName);
      if ((segmentName == null || fileName.startsWith(segmentPrefix1) || fileName.startsWith(segmentPrefix2)) &&
          !fileName.endsWith("write.lock") &&
          !refCounts.containsKey(fileName) &&
          !fileName.equals(IndexFileNames.SEGMENTS_GEN) &&
          (m.matches() || fileName.startsWith(IndexFileNames.SEGMENTS))) {
View Full Code Here

        PrintWriter out = new PrintWriter(string);
        String line;
        Matcher m = ENCRYPTED_STRING.matcher("");
        try {
            while((line = in.readLine()) != null) {
                m.reset(line);
                int last = -1;
                while(m.find()) {
                    out.print(line.substring(last+1, m.start()));
                    String s = line.substring(m.start(), m.end());
                    out.print("\"");
View Full Code Here

                }
                if(stop != null && stop.intValue() < lineCount) {
                    continue;
                }
                if(text != null) {
                    text.reset(line);
                    if(!text.find()) {
                        continue;
                    }
                }
                list.add(new LogMessage(lineCount,line.toString()));
View Full Code Here

                            ++fileCount;
                            if (capped) {
                                continue;
                            }
                            CharSequence line = cb.subSequence(lines.start(), lines.end());
                            target.reset(line);
                            if (target.find()) {
                                if (host != null && !host.equals(target.group(GROUP_HOST))) {
                                    continue;
                                }
                                if (user != null && !user.equals(target.group(GROUP_USER))) {
View Full Code Here

                    continue;
                }
                target.reset(line);
                if(target.find()) {
                    if(text != null) {
                        text.reset(line);
                        if(!text.find()) {
                            hit = false;
                            continue;
                        }
                    }
View Full Code Here

                            ++lineCount;
                            ++fileLineCount;
                            if(capped) {
                                continue;
                            }
                            target.reset(line);
                            if(target.find()) {
                                if(host != null && !host.equals(target.group(GROUP_HOST))) {
                                    continue;
                                }
                                if(user != null && !user.equals(target.group(GROUP_USER))) {
View Full Code Here

      String varValue = env.get(varName);
      if (varValue == null) {
        varValue = "";
      }
      classpath = (classpath.substring(0, envMatcher.start()) + varValue + classpath.substring(envMatcher.end()));
      envMatcher.reset(classpath);
    }
    return classpath;
  }
 
  /**
 
View Full Code Here

                ++lineCount;
                if(capped) {
                    continue;
                }
                CharSequence line = cb.subSequence(lines.start(), lines.end());
                target.reset(line);
                if(target.find()) {
                    if(host != null && !host.equals(target.group(GROUP_HOST))) {
                        continue;
                    }
                    if(user != null && !user.equals(target.group(GROUP_USER))) {
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.