Package net.solarnetwork.node.backup
Class ZipStreamBackupResource
java.lang.Object
net.solarnetwork.node.backup.ZipStreamBackupResource
- All Implemented Interfaces:
BackupResource
A zip input stream backup resource.
- Since:
- 1.46
- Version:
- 1.2
- Author:
- matt
-
Constructor Summary
ConstructorsConstructorDescriptionZipStreamBackupResource(InputStream stream, ZipEntry entry, String providerKey, String path) Construct with values. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidfinalize()Get a relative path to save this resource to in the backup.Get anInputStreamto the resource.longGet the modification date of the resource, in milliseconds since the epoch.Get the key of theBackupResourceProviderthat provided this resource.Get the expected SHA-256 digest of the resource content.
-
Constructor Details
-
ZipStreamBackupResource
Construct with values.- Parameters:
stream- the zip archive streamentry- the entry previously obtained from the zip archiveproviderKey- the provider keypath- the path to use
-
-
Method Details
-
getProviderKey
Description copied from interface:BackupResourceGet the key of theBackupResourceProviderthat provided this resource.- Specified by:
getProviderKeyin interfaceBackupResource- Returns:
- The provider key.
-
getBackupPath
Description copied from interface:BackupResourceGet a relative path to save this resource to in the backup.This must be a URL-like path, using a forward slash to represent directories. For example, the a path could be
some/path/here.txt.- Specified by:
getBackupPathin interfaceBackupResource- Returns:
- the relative path
-
getInputStream
Description copied from interface:BackupResourceGet anInputStreamto the resource.- Specified by:
getInputStreamin interfaceBackupResource- Returns:
- an InputStream to the data for the resource
- Throws:
IOException- if any IO error occurs
-
getModificationDate
public long getModificationDate()Description copied from interface:BackupResourceGet the modification date of the resource, in milliseconds since the epoch.- Specified by:
getModificationDatein interfaceBackupResource- Returns:
- the modification date, or -1 if not known
-
finalize
-
getSha256Digest
Description copied from interface:BackupResourceGet the expected SHA-256 digest of the resource content.This value is meant to be used to verify the integrity of the content of the resource when read from
BackupResource.getInputStream().- Specified by:
getSha256Digestin interfaceBackupResource- Returns:
- the SHA-256 digest as a hex-encoded string, or null if not known
-