Add static factory for SyncFileInfo for service dump
@@ -58,6 +58,14 @@ public class SyncFileInfo {
logFile, uri.resolve(dir + logFile.getFileName() + compression.extension), compression));
}
+ public static Optional<SyncFileInfo> forServiceDump(URI directory, Path file) {
+ String filename = file.getFileName().toString();
+ Compression compression = filename.endsWith(".bin") ? Compression.ZSTD : Compression.NONE;
+ if (filename.startsWith(".")) return Optional.empty();
+ URI location = directory.resolve(filename + compression.extension);
+ return Optional.of(new SyncFileInfo(file, location, compression));
+ }
+
public enum Compression {
NONE(""), ZSTD(".zst");
