Class DatabaseConfiguration


  • public final class DatabaseConfiguration
    extends Object
    Configuration for opening a database.
    • Constructor Detail

      • DatabaseConfiguration

        public DatabaseConfiguration()
    • Method Detail

      • setEncryptionKey

        @NonNull
        public DatabaseConfiguration setEncryptionKey​(@Nullable
                                                      EncryptionKey encryptionKey)
        ENTERPRISE EDITION API

        Set a key to encrypt the database with. If the database does not exist and is being created, it will use this key, and the same key must be given every time it's opened

        Parameters:
        encryptionKey - the key
        Returns:
        The self object.
      • getEncryptionKey

        @Nullable
        public EncryptionKey getEncryptionKey()
        ENTERPRISE EDITION API

        Returns a key to encrypt the database with.

        Returns:
        the key
      • setDirectory

        @NonNull
        public DatabaseConfiguration setDirectory​(@NonNull
                                                  String directory)
        Set the canonical path of the directory to store the database in. If the directory doesn't already exist it will be created. If it cannot be created throw an IllegalStateException
        Parameters:
        directory - the directory
        Returns:
        this.
        Throws:
        IllegalStateException - if the directory does not exist anc cannot be created
      • getDirectory

        @NonNull
        public String getDirectory()
        Returns the path to the directory that contains the database. If this path has not been set explicitly (see: setDirectory below), then it is the system default.
        Returns:
        the database directory