Package com.couchbase.lite
Class DatabaseConfiguration
- java.lang.Object
-
- com.couchbase.lite.DatabaseConfiguration
-
public final class DatabaseConfiguration extends Object
Configuration for opening a database.
-
-
Constructor Summary
Constructors Constructor Description DatabaseConfiguration()
DatabaseConfiguration(DatabaseConfiguration config)
Copy constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DatabaseConfiguration
getDatabaseConfiguration()
String
getDirectory()
Returns the path to the directory that contains the database.EncryptionKey
getEncryptionKey()
ENTERPRISE EDITION APIDatabaseConfiguration
setDirectory(String directory)
Set the canonical path of the directory in which to store the database.DatabaseConfiguration
setEncryptionKey(EncryptionKey encryptionKey)
ENTERPRISE EDITION API
-
-
-
Constructor Detail
-
DatabaseConfiguration
public DatabaseConfiguration()
-
DatabaseConfiguration
public DatabaseConfiguration(@Nullable DatabaseConfiguration config)
Copy constructor- Parameters:
config
- the configuration to duplicate.
-
-
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:
- this.
-
getEncryptionKey
@Nullable public EncryptionKey getEncryptionKey()
ENTERPRISE EDITION API
Returns a key to encrypt the database with.
- Returns:
- the key
-
getDatabaseConfiguration
@NonNull protected DatabaseConfiguration getDatabaseConfiguration()
-
setDirectory
@NonNull public DatabaseConfiguration setDirectory(@NonNull String directory)
Set the canonical path of the directory in which to store the database. If the directory doesn't already exist it will be created. If it cannot be created an IllegalStateException will be thrown.- Parameters:
directory
- the directory- Returns:
- this.
- Throws:
IllegalStateException
- if the directory does not exist and 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
-
-