public class BackupFSArchiveCopy extends Object implements BackupFileCopy
| Modifier and Type | Field and Description |
|---|---|
static String |
CHECKSUM_KEY |
| Constructor and Description |
|---|
BackupFSArchiveCopy() |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
checksum(URL archiveURL)
Returns the checksum computed by reading archiveFile.
|
byte[] |
copy(File localFile,
URL archiveURL)
Note that the copy implementation can afford to be simple and not clean
up on failure since a partially copied archiveURL file can never be part
of the manifest.
|
String |
getChecksumAlg()
Returns the checksum algorithm used to checksum the archive file
being accessed.
|
String |
getCompressionAlg()
Returns the compression algorithm used to compress the archive file
being accessed.
|
String |
getEncryptionAlg()
Returns the encryption algorithm used to encrypt/decrypt the archive
file being accessed.
|
void |
initialize(File configFile)
initialize is invoked exactly once after the creation of the object via
its noargs constructor.
|
public static final String CHECKSUM_KEY
public void initialize(File configFile) throws InterruptedException, IOException
BackupFileCopyinitialize in interface BackupFileCopyconfigFile - the config file used to initialize the object. It
could, for example, contain the credentials needed to access the
archive,the compression and encryption algorithms used to store archive
files, etc. The format of the config file (properties, json, etc.) is
private to the implementation.InterruptedException - if the initialize operation is interruptedIOException - if some irrecoverable I/O issue was encountered
during initialization.public String getEncryptionAlg()
BackupFileCopyBackupFileCopy.initialize(java.io.File). The algorithm name is a valid
argument to Cipher or the
provider overloading used by the implementation.getEncryptionAlg in interface BackupFileCopypublic String getCompressionAlg()
BackupFileCopyBackupFileCopy.initialize(java.io.File).getCompressionAlg in interface BackupFileCopypublic String getChecksumAlg()
BackupFileCopyBackupFileCopy.initialize(java.io.File). The algorithm name is a valid
argument to MessageDigest.getInstance(String) or
the provider overloading used by the implementation.getChecksumAlg in interface BackupFileCopypublic byte[] copy(File localFile, URL archiveURL) throws InterruptedException, IOException
copy in interface BackupFileCopylocalFile - the file to be copiedarchiveURL - the target path for the copy; it must be an absolute
URLInterruptedException - if the copy is interruptedIOException - if some irrecoverable I/O issue was encountered
either while reading or writing the file.public byte[] checksum(URL archiveURL) throws InterruptedException, IOException
BackupFileCopyBackupFileCopy.initialize(java.io.File)checksum in interface BackupFileCopyarchiveURL - the archive file being read to compute the checksum
value; it must be an absolute URLInterruptedException - if the checksum operation is interruptedIOException - if some irrecoverable I/O issue was encountered
while reading the archiveFileCopyright © 2024. All rights reserved.