Class Migrators
- java.lang.Object
-
- org.cryptomator.cryptofs.migration.Migrators
-
public class Migrators extends Object
Used to perform migration from an older vault format to a newer one.Example Usage:
if (Migrators.get().needsMigration(pathToVault, masterkeyFileName)) { Migrators.get().migrate(pathToVault, masterkeyFileName, passphrase, migrationProgressListener); }- Since:
- 1.4.0
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Migratorsget()voidmigrate(Path pathToVault, String masterkeyFilename, CharSequence passphrase, MigrationProgressListener progressListener)Performs the actual migration.booleanneedsMigration(Path pathToVault, String masterkeyFilename)Inspects the vault and checks if it is supported by this library.
-
-
-
Method Detail
-
get
public static Migrators get()
-
needsMigration
public boolean needsMigration(Path pathToVault, String masterkeyFilename) throws IOException
Inspects the vault and checks if it is supported by this library.- Parameters:
pathToVault- Path to the vault's rootmasterkeyFilename- Name of the masterkey file 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 masterkeyFilename, CharSequence passphrase, MigrationProgressListener progressListener) throws NoApplicableMigratorException, org.cryptomator.cryptolib.api.InvalidPassphraseException, IOException
Performs the actual migration. This task may take a while and this method will block.- Parameters:
pathToVault- Path to the vault's rootmasterkeyFilename- Name of the masterkey file located in the vaultpassphrase- The passphrase needed to unlock the vault- 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 vault
-
-