Package net.solarnetwork.node.backup
Interface BackupResource
- All Known Implementing Classes:
ResourceBackupResource,ZipEntryBackupResource,ZipStreamBackupResource
public interface BackupResource
API for a resource to take part in the backup system.
- Version:
- 1.2
- Author:
- matt
-
Method Summary
Modifier and TypeMethodDescriptionGet 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.
-
Method Details
-
getBackupPath
String getBackupPath()Get 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.- Returns:
- the relative path
-
getInputStream
Get anInputStreamto the resource.- Returns:
- an InputStream to the data for the resource
- Throws:
IOException- if any IO error occurs
-
getModificationDate
long getModificationDate()Get the modification date of the resource, in milliseconds since the epoch.- Returns:
- the modification date, or -1 if not known
-
getProviderKey
String getProviderKey()Get the key of theBackupResourceProviderthat provided this resource.- Returns:
- The provider key.
- Since:
- 1.1
-
getSha256Digest
String getSha256Digest()Get 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
getInputStream().- Returns:
- the SHA-256 digest as a hex-encoded string, or null if not known
- Since:
- 1.2
-