public void paths(Node<?> dir, Filter filter, List<String> result) throws IOException { String path; for (Node<?> node : dir.find(filter)) { path = node.getRelative(dir); if (!result.contains(path)) { result.add(path); } } }
public Map<String, String> list(String prefix) throws IOException { Map<String, String> result; String relative; result = new LinkedHashMap<>(); if (dir.exists()) { for (Node node : dir.find("**/*.log")) { relative = node.getRelative(dir); result.put(relative, prefix + relative.replace("/", "::")); } } return result; }
private void rotateLogs(Stage stage) throws IOException { Node archived; for (Node logfile : stage.getBackstage().find("**/*.log")) { archived = archiveDirectory(logfile).join(logfile.getName() + ".gz"); console.verbose.println(String.format("rotating %s to %s", logfile.getRelative(stage.getBackstage()), archived.getRelative(stage.getBackstage()))); logfile.gzip(archived); logfile.deleteFile(); } }
/** * Returns a String representation suitable for messages. * * CAUTION: don't use to convert to a string, use instead. */ @Override public String toString() { Node working; working = getWorld().getWorking(); if (working == null || !getRoot().equals(working.getRoot())) { return getUri().toString(); } else { if (hasAncestor(working)) { return getRelative(working); } else { return Filesystem.SEPARATOR_STRING + getPath(); } } }
} else { dest.getParent().mkdirsOpt(); if (content == null || binary.matches(src.node.getRelative(sourcedir))) { src.node.copyFile(dest); } else {