Package org.cryptomator.cryptofs
Class CryptoFileSystemProperties.Builder
- java.lang.Object
-
- org.cryptomator.cryptofs.CryptoFileSystemProperties.Builder
-
- Enclosing class:
- CryptoFileSystemProperties
public static class CryptoFileSystemProperties.Builder extends Object
BuildsCryptoFileSystemProperties
-
-
Field Summary
Fields Modifier and Type Field Description byte[]pepper
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description CryptoFileSystemPropertiesbuild()Validates the values and creates newCryptoFileSystemProperties.CryptoFileSystemProperties.BuilderwithFlags(Collection<CryptoFileSystemProperties.FileSystemFlags> flags)Sets the flags for a CryptoFileSystem.CryptoFileSystemProperties.BuilderwithFlags(CryptoFileSystemProperties.FileSystemFlags... flags)Sets the flags for a CryptoFileSystem.CryptoFileSystemProperties.BuilderwithMasterkeyFilename(String masterkeyFilename)Sets the name of the masterkey file located inside the vault directory.CryptoFileSystemProperties.BuilderwithPassphrase(CharSequence passphrase)Sets the passphrase to use for a CryptoFileSystem.CryptoFileSystemProperties.BuilderwithPepper(byte[] pepper)Sets the pepper for a CryptoFileSystem.CryptoFileSystemProperties.BuilderwithReadonlyFlag()Deprecated.Will be removed in 2.0.0.
-
-
-
Method Detail
-
withPassphrase
public CryptoFileSystemProperties.Builder withPassphrase(CharSequence passphrase)
Sets the passphrase to use for a CryptoFileSystem.- Parameters:
passphrase- the passphrase to use- Returns:
- this
-
withPepper
public CryptoFileSystemProperties.Builder withPepper(byte[] pepper)
Sets the pepper for a CryptoFileSystem.- Parameters:
pepper- A pepper used during key derivation- Returns:
- this
- Since:
- 1.3.2
-
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
-
withReadonlyFlag
@Deprecated public CryptoFileSystemProperties.Builder withReadonlyFlag()
Deprecated.Will be removed in 2.0.0. UsewithFlags(FileSystemFlags.READONLY)Sets the readonly flag for a CryptoFileSystem.- Returns:
- this
-
withMasterkeyFilename
public CryptoFileSystemProperties.Builder withMasterkeyFilename(String masterkeyFilename)
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
public CryptoFileSystemProperties 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
-
-