public List<File> listSnapshots() { File snapshotsDir = SnapshotUtil.getSnapshotDirectory(this); List<File> files = new ArrayList<File>(FileUtils.listFiles(snapshotsDir, new String[] {"zip"}, false)); Collections.sort( files, new Comparator<File>() { public int compare(File o1, File o2) { return -o1.compareTo(o2); } }); return files; }
public File snapshot() { return SnapshotUtil.createSnapshot(this); }