java.lang.Object
org.cryptomator.cryptofs.migration.Migrators
Used to perform migration from an older vault format to a newer one.
Example Usage:
if (Migrators.get().needsMigration(Path, String, String) needsMigration(pathToVault, vaultConfigFilename, masterkeyFileName)}) {
Migrators.get().migrate(pathToVault, masterkeyFileName, passphrase, progressListener, continuationListener);
}
- Since:
- 1.4.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic Migratorsget()voidmigrate(Path pathToVault, String vaultConfigFilename, String masterkeyFilename, CharSequence passphrase, MigrationProgressListener progressListener, MigrationContinuationListener continuationListener) Performs the actual migration.booleanneedsMigration(Path pathToVault, String vaultConfigFilename, String masterkeyFilename) Inspects the vault and checks if it is supported by this library.
-
Method Details
-
get
-
needsMigration
public boolean needsMigration(Path pathToVault, String vaultConfigFilename, String masterkeyFilename) throws IOException Inspects the vault and checks if it is supported by this library.- Parameters:
pathToVault- Path to the vault's rootvaultConfigFilename- Name of the vault config file located in the vaultmasterkeyFilename- Name of the masterkey file optionally located in the vault- Returns:
trueif the vault at the given path is of an older format than supported by this library- Throws:
IOException- if an I/O error occurs parsing the masterkey file
-
migrate
public void migrate(Path pathToVault, String vaultConfigFilename, String masterkeyFilename, CharSequence passphrase, MigrationProgressListener progressListener, MigrationContinuationListener continuationListener) throws NoApplicableMigratorException, org.cryptomator.cryptolib.api.CryptoException, IOException Performs the actual migration. This task may take a while and this method will block.- Parameters:
pathToVault- Path to the vault's rootvaultConfigFilename- Name of the vault config file located insidepathToVaultmasterkeyFilename- Name of the masterkey file located insidepathToVaultpassphrase- The passphrase needed to unlock the vaultprogressListener- Listener that will get notified of progress updatescontinuationListener- Listener that will get asked if there are events that require feedback- Throws:
NoApplicableMigratorException- If the vault can not be migrated, because no migrator could be foundorg.cryptomator.cryptolib.api.InvalidPassphraseException- If the passphrase could not be used to unlock the vaultFileSystemCapabilityChecker.MissingCapabilityException- If the underlying filesystem lacks features required to store a vaultIOException- if an I/O error occurs migrating the vaultorg.cryptomator.cryptolib.api.CryptoException
-