private List<LogEntry> getUnorderedAuthorLogEntries(String author) { List<LogEntry> entries = new LinkedList<LogEntry>(); for (LogEntry logEntry : logEntries) { if (logEntry.getAuthor().equals(author)) { entries.add(logEntry); } } return entries; }
public List<String> getAuthors() { List<String> authors = new LinkedList<String>(); for (LogEntry logEntry : logEntries) { if (!authors.contains(logEntry.getAuthor())) { authors.add(logEntry.getAuthor()); } } Collections.sort(authors); return authors; }
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; }
public List<PathEntry> getOrderedByRevisionAuthorPathEntries(String author) { List<PathEntry> orderedPathEntries = new LinkedList<PathEntry>(); List<LogEntry> logEntries = getUnorderedAuthorLogEntries(author); for (LogEntry logEntry : logEntries) { List<PathEntry> pathEntries = logEntry.getPathEntries(); for (PathEntry pathEntry : pathEntries) { orderedPathEntries.add(pathEntry); } } Collections.sort(orderedPathEntries); return orderedPathEntries; }
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; }
/** * Protected method for simplyfied addinng of mapped files * * @param file file to add * @param baseDir base directory for file */ protected void addMappedFile(File file, File baseDir) { if (file.isFile()) { if (baseDir == null) { baseDir = file.getParentFile(); } MappedFile mappedFile = new MappedFile(); mappedFile.setFrom(file); String filename = file.getName(); String[] names = getMapper().mapFileName(filename); // we don't use original filename if no mapping is available if (names == null || names.length == 0) { return; } File newFile = new File(file.getParent() + System.getProperty("file.separator") + names[0]); if (getDestDir() != null) { try { newFile = new File( newFile .getCanonicalPath() .replace(baseDir.getCanonicalPath(), getDestDir().getCanonicalPath())); } catch (IOException ex) { log("Couldn't map file", ex, Project.MSG_WARN); return; } } mappedFile.setTo(newFile); mappedFiles.add(mappedFile); } else if (file.isDirectory()) { if (baseDir == null) { baseDir = file; } DirectoryScanner ds = new DirectoryScanner(); ds.setBasedir(file); ds.scan(); for (String fileName : ds.getIncludedFiles()) { addMappedFile(new File(file + System.getProperty("file.separator") + fileName), baseDir); } } }
public void addLogEntry(LogEntry logEntry) { logEntries.add(logEntry); isOrdered = false; }
/** * Add resource collection * * @param rc resource collection to add */ public void add(ResourceCollection rc) { resources.add(rc); }
@Override public void addTask(Task task) { tasks.add(task); }