Class Migrators

    • Method Detail

      • 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 root
        masterkeyFilename - Name of the masterkey file located in the vault
        Returns:
        true if 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 root
        masterkeyFilename - Name of the masterkey file located in the vault
        passphrase - The passphrase needed to unlock the vault
        Throws:
        NoApplicableMigratorException - If the vault can not be migrated, because no migrator could be found
        org.cryptomator.cryptolib.api.InvalidPassphraseException - If the passphrase could not be used to unlock the vault
        FileSystemCapabilityChecker.MissingCapabilityException - If the underlying filesystem lacks features required to store a vault
        IOException - if an I/O error occurs migrating the vault