java.lang.Object
org.cryptomator.cryptofs.DirectoryIdBackup
Single purpose class to back up the directory id of an encrypted directory when it is created.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidbackupManually(org.cryptomator.cryptolib.api.Cryptor cryptor, CryptoPathMapper.CiphertextDirectory ciphertextDirectory) Static method to explicitly back up the directory id for a specified ciphertext directory.voidexecute(CryptoPathMapper.CiphertextDirectory ciphertextDirectory) Performs the backup operation for the givenCryptoPathMapper.CiphertextDirectoryobject.
-
Constructor Details
-
DirectoryIdBackup
@Inject public DirectoryIdBackup(org.cryptomator.cryptolib.api.Cryptor cryptor)
-
-
Method Details
-
execute
Performs the backup operation for the givenCryptoPathMapper.CiphertextDirectoryobject.The directory id is written via an encrypting channel to the file
CryptoPathMapper.CiphertextDirectory.path/"dirid.c9r".- Parameters:
ciphertextDirectory- The cipher dir object containing the dir id and the encrypted content root- Throws:
IOException- if an IOException is raised during the write operation
-
backupManually
public static void backupManually(org.cryptomator.cryptolib.api.Cryptor cryptor, CryptoPathMapper.CiphertextDirectory ciphertextDirectory) throws IOException Static method to explicitly back up the directory id for a specified ciphertext directory.- Parameters:
cryptor- The cryptor to be usedciphertextDirectory- ACryptoPathMapper.CiphertextDirectoryfor which the dirId should be back up'd.- Throws:
IOException- when the dirId file already exists, or it cannot be written to.
-