public T deleteFileOpt() throws IOException { if (exists()) { deleteFile(); } return (T) this; }
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(); } }