public class MigrationZipFile extends Object implements Closeable
Constructor and Description |
---|
MigrationZipFile(Path zipPath)
Opens a MigrationZipFile for reading encrypted entries using default locations for the key and
checksum files
|
MigrationZipFile(Path zipPath,
Path keyPath,
Path checksumPath)
Opens a MigrationZipFile for reading encrypted entries using custom locations for the key and
checksum files
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
deleteQuitetly()
Deletes the file, key, and checksum
|
Path |
getChecksumPath() |
InputStream |
getInputStream(ZipEntry entry)
Wraps the
InputStream from ZipFile.getInputStream with a CipherInputStream |
Path |
getKeyPath() |
Path |
getZipPath() |
boolean |
isClosed() |
boolean |
isValidChecksum()
Determines if the MigrationZipFile checksum is valid.
|
Stream<? extends ZipEntry> |
stream()
Proxy for ZipFile.stream();
|
public MigrationZipFile(Path zipPath) throws IOException
zipPath
- path to zip fileIOException
- when there is a problem reading the zip filepublic MigrationZipFile(Path zipPath, Path keyPath, Path checksumPath) throws IOException
zipPath
- path to zip filekeyPath
- path to key filechecksumPath
- path to checksum fileIOException
public InputStream getInputStream(ZipEntry entry) throws IOException
InputStream
from ZipFile.getInputStream with a CipherInputStream
entry
- IOException
public boolean isValidChecksum()
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public Path getZipPath()
public Path getChecksumPath()
public Path getKeyPath()
public boolean isClosed()
public void deleteQuitetly()
This work is licensed under a Creative Commons Attribution 4.0 International License.