use of com.instaclustr.esop.impl.Manifest.ManifestAgePathComparator in project esop by instaclustr.
the class LocalFileRestorer method listManifests.
@Override
public List<Manifest> listManifests() throws Exception {
assert objectMapper != null;
final Path path = Paths.get(storageLocation.rawLocation.replaceAll("file://", ""), "manifests");
if (!Files.exists(path))
return Collections.emptyList();
final List<Path> manifests = Files.list(path).sorted(new ManifestAgePathComparator()).collect(toList());
final List<Manifest> manifestsList = new ArrayList<>();
for (final Path manifest : manifests) {
final Manifest read = Manifest.read(manifest, objectMapper);
read.setManifest(new ManifestEntry(Paths.get("manifests", manifest.getFileName().toString()), manifest, Type.FILE, null));
manifestsList.add(read);
}
return manifestsList;
}
Aggregations