Module org.cryptomator.cryptofs
Package org.cryptomator.cryptofs
Class CryptoFileSystemProperties.Builder
java.lang.Object
org.cryptomator.cryptofs.CryptoFileSystemProperties.Builder
- Enclosing class:
- CryptoFileSystemProperties
Builds
CryptoFileSystemProperties-
Field Summary
FieldsModifier and TypeFieldDescriptionorg.cryptomator.cryptolib.api.CryptorProvider.Scheme -
Method Summary
Modifier and TypeMethodDescriptionbuild()Validates the values and creates newCryptoFileSystemProperties.withCipherCombo(org.cryptomator.cryptolib.api.CryptorProvider.Scheme cipherCombo) Sets the cipher combo used during vault initialization.Sets the flags for a CryptoFileSystem.Sets the flags for a CryptoFileSystem.withKeyLoader(org.cryptomator.cryptolib.api.MasterkeyLoader keyLoader) Sets the keyloader for a CryptoFileSystem.withMasterkeyFilename(String masterkeyFilename) Deprecated.withMaxCleartextNameLength(int maxCleartextNameLength) Sets the maximum cleartext filename length for a CryptoFileSystem.withShorteningThreshold(int shorteningThreshold) Sets the shortening threshold used during vault initialization.withVaultConfigFilename(String vaultConfigFilename) Sets the name of the vault config file located inside the vault directory.
-
Field Details
-
cipherCombo
public org.cryptomator.cryptolib.api.CryptorProvider.Scheme cipherCombo
-
-
Method Details
-
withMaxCleartextNameLength
Sets the maximum cleartext filename length for a CryptoFileSystem. This value is checked during write operations. Read access to nodes with longer names should be unaffected. Setting this value to0or a negative value effectively disables write access.- Parameters:
maxCleartextNameLength- The maximum cleartext filename length allowed- Returns:
- this
- Since:
- 2.0.0
-
withShorteningThreshold
Sets the shortening threshold used during vault initialization.- Parameters:
shorteningThreshold- The maximum ciphertext filename length not to be shortened- Returns:
- this
- Since:
- 2.5.0
-
withCipherCombo
public CryptoFileSystemProperties.Builder withCipherCombo(org.cryptomator.cryptolib.api.CryptorProvider.Scheme cipherCombo) Sets the cipher combo used during vault initialization.- Parameters:
cipherCombo- The cipher combo- Returns:
- this
- Since:
- 2.0.0
-
withKeyLoader
public CryptoFileSystemProperties.Builder withKeyLoader(org.cryptomator.cryptolib.api.MasterkeyLoader keyLoader) Sets the keyloader for a CryptoFileSystem.- Parameters:
keyLoader- A factory creating aMasterkeyLoadercapable of handling the givenscheme.- Returns:
- this
- Since:
- 2.0.0
-
withFlags
public CryptoFileSystemProperties.Builder withFlags(CryptoFileSystemProperties.FileSystemFlags... flags) Sets the flags for a CryptoFileSystem.- Parameters:
flags- File system flags- Returns:
- this
- Since:
- 1.3.1
-
withFlags
public CryptoFileSystemProperties.Builder withFlags(Collection<CryptoFileSystemProperties.FileSystemFlags> flags) Sets the flags for a CryptoFileSystem.- Parameters:
flags- collection of file system flags- Returns:
- this
- Since:
- 1.3.0
-
withVaultConfigFilename
Sets the name of the vault config file located inside the vault directory.- Parameters:
vaultConfigFilename- the filename of the jwt file containing the vault configuration- Returns:
- this
- Since:
- 2.0.0
-
withMasterkeyFilename
@Deprecated public CryptoFileSystemProperties.Builder withMasterkeyFilename(String masterkeyFilename) Deprecated.Supply akeyloaderinstead.Sets the name of the masterkey file located inside the vault directory.- Parameters:
masterkeyFilename- the filename of the json file containing configuration to decrypt the masterkey- Returns:
- this
- Since:
- 1.1.0
-
build
Validates the values and creates newCryptoFileSystemProperties.- Returns:
- a new
CryptoFileSystemPropertieswith the values from this builder - Throws:
IllegalStateException- if a required value was not set on thisBuilder
-
keyloaderinstead.