use of com.enonic.xp.repo.impl.dump.blobstore.ZipDumpWriteBlobStore in project xp by enonic.
the class ZipDumpWriter method create.
public static ZipDumpWriter create(final Path basePath, final String dumpName, final BlobStore blobStore) {
Preconditions.checkArgument(FileNames.isSafeFileName(dumpName));
try {
final ZipArchiveOutputStream zipArchiveOutputStream = new ZipArchiveOutputStream(Files.newByteChannel(basePath.resolve(dumpName + ZIP_FILE_EXTENSION), StandardOpenOption.CREATE, StandardOpenOption.WRITE, StandardOpenOption.READ, StandardOpenOption.TRUNCATE_EXISTING));
final ZipDumpWriteBlobStore zipDumpWriteBlobStore = new ZipDumpWriteBlobStore(dumpName, zipArchiveOutputStream);
return new ZipDumpWriter(blobStore, new DefaultFilePaths(PathRef.of(dumpName)), zipDumpWriteBlobStore, zipArchiveOutputStream);
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
Aggregations