コード例 #1
0
ファイル: LogReport.java プロジェクト: irudyak/ant-toolkit
  private void writeLogEntry(PrintWriter out, LogEntry logEntry) {
    if (logEntry.getEntriesCount() == 0) {
      return;
    }

    String message = logEntry.getMessage().replace(QUOTE_CHARACTER, QUOTE_SPECIAL_CHARACTER);
    message =
        message.replace(ANGLE_OPENING_BRACKET_CHARACTER, ANGLE_OPENING_BRACKET_SPECIAL_CHARACTER);
    message =
        message.replace(ANGLE_CLOSING_BRACKET_CHARACTER, ANGLE_CLOSING_BRACKET_SPECIAL_CHARACTER);

    out.println(
        MessageFormat.format(
            LOGENTRY_START_NODE,
            new String[] {message, Integer.toString(logEntry.getRevision()), logEntry.getDate()}));

    List<PathEntry> pathEntries = logEntry.getPathEntries();
    for (PathEntry pathEntry : pathEntries) {
      out.println(
          MessageFormat.format(
              PATH_NODE, new String[] {pathEntry.getAction(), pathEntry.getPath()}));
    }

    out.println(LOGENTRY_END_NODE);
  }
コード例 #2
0
ファイル: LogReport.java プロジェクト: irudyak/ant-toolkit
  public List<String> getUniquePaths() {
    List<String> uniquePathEntries = new LinkedList<String>();

    for (LogEntry logEntry : logEntries) {
      List<PathEntry> pathEntries = logEntry.getPathEntries();
      for (PathEntry pathEntry : pathEntries) {
        if (!uniquePathEntries.contains(pathEntry.getPath())) {
          uniquePathEntries.add(pathEntry.getPath());
        }
      }
    }

    return uniquePathEntries;
  }
コード例 #3
0
ファイル: LogReport.java プロジェクト: irudyak/ant-toolkit
  public int getLastModificationRevisionForPath(String path) {
    int revision = -1;

    for (LogEntry logEntry : logEntries) {
      List<PathEntry> pathEntries = logEntry.getPathEntries();
      for (PathEntry pathEntry : pathEntries) {
        if (pathEntry.getPath().equals(path) && revision < pathEntry.getRevision()) {
          revision = pathEntry.getRevision();
          break;
        }
      }
    }

    return revision;
  }
コード例 #4
0
ファイル: LogReport.java プロジェクト: irudyak/ant-toolkit
  public List<String> getAuthorUniquePaths(String author) {
    List<LogEntry> logEntries = getUnorderedAuthorLogEntries(author);
    List<String> uniquePathEntries = new LinkedList<String>();

    for (LogEntry logEntry : logEntries) {
      List<PathEntry> pathEntries = logEntry.getPathEntries();
      for (PathEntry pathEntry : pathEntries) {
        if (!uniquePathEntries.contains(pathEntry.getPath())) {
          uniquePathEntries.add(pathEntry.getPath());
        }
      }
    }

    return uniquePathEntries;
  }
コード例 #5
0
ファイル: LogReport.java プロジェクト: irudyak/ant-toolkit
  public boolean hasSamePathEntryWithHigherRevisionForAuthor(PathEntry pathEntry, String author) {
    for (LogEntry logEntry : logEntries) {
      if (!logEntry.getAuthor().equals(author)
          || logEntry.getRevision() < pathEntry.getRevision()) {
        continue;
      }

      List<PathEntry> pathEntries = logEntry.getPathEntries();
      for (PathEntry _pathEntry : pathEntries) {
        if (_pathEntry.getPath().equals(pathEntry.getPath())
            && _pathEntry.getAction().equals(pathEntry.getAction())) {
          return true;
        }
      }
    }

    return false;
  }