Module org.cryptomator.cryptofs
Package org.cryptomator.cryptofs.common
Class FileSystemCapabilityChecker
java.lang.Object
org.cryptomator.cryptofs.common.FileSystemCapabilityChecker
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidassertAllCapabilities(Path pathToVault) Checks whether the underlying filesystem has all required capabilities.voidassertReadAccess(Path pathToVault) Checks whether the underlying filesystem allows reading the given dir.voidassertWriteAccess(Path pathToVault) Checks whether the underlying filesystem allows writing to the given dir.intdetermineSupportedCiphertextFileNameLength(Path pathToVault) Determinse the number of chars a ciphertext filename (including its extension) is allowed to have inside a vault'sd/XX/YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY/directory.intdetermineSupportedCiphertextFileNameLength(Path dir, int subPathLength, int minFileNameLength, int maxFileNameLength) Determines the number of chars a filename is allowed to have inside of subdirectories ofdirby running an experiment.intdetermineSupportedCleartextFileNameLength(Path pathToVault)
-
Constructor Details
-
FileSystemCapabilityChecker
@Inject public FileSystemCapabilityChecker()
-
-
Method Details
-
assertAllCapabilities
public void assertAllCapabilities(Path pathToVault) throws FileSystemCapabilityChecker.MissingCapabilityException Checks whether the underlying filesystem has all required capabilities.- Implementation Note:
- Only short-running tests with constant time are performed
- Parameters:
pathToVault- Path to a vault's storage location- Throws:
FileSystemCapabilityChecker.MissingCapabilityException- if any check fails- Since:
- 1.9.2
-
assertReadAccess
public void assertReadAccess(Path pathToVault) throws FileSystemCapabilityChecker.MissingCapabilityException Checks whether the underlying filesystem allows reading the given dir.- Parameters:
pathToVault- Path to a vault's storage location- Throws:
FileSystemCapabilityChecker.MissingCapabilityException- if the check fails- Since:
- 1.9.3
-
assertWriteAccess
public void assertWriteAccess(Path pathToVault) throws FileSystemCapabilityChecker.MissingCapabilityException Checks whether the underlying filesystem allows writing to the given dir.- Parameters:
pathToVault- Path to a vault's storage location- Throws:
FileSystemCapabilityChecker.MissingCapabilityException- if the check fails- Since:
- 1.9.3
-
determineSupportedCleartextFileNameLength
- Throws:
IOException
-
determineSupportedCiphertextFileNameLength
Determinse the number of chars a ciphertext filename (including its extension) is allowed to have inside a vault'sd/XX/YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY/directory.- Parameters:
pathToVault- Path to the vault- Returns:
- Number of chars a .c9r file is allowed to have
- Throws:
IOException- If unable to perform this check
-
determineSupportedCiphertextFileNameLength
public int determineSupportedCiphertextFileNameLength(Path dir, int subPathLength, int minFileNameLength, int maxFileNameLength) throws IOException Determines the number of chars a filename is allowed to have inside of subdirectories ofdirby running an experiment.- Parameters:
dir- Path to a directory where to conduct the experiment (e.g./path/to/vault/c)subPathLength- Defines the combined number of chars of the subdirectories insidedir, including slashes but excluding the leading slash. Must be a minimum of 6minFileNameLength- The minimum filename length to checkmaxFileNameLength- The maximum filename length to check- Returns:
- The supported filename length inside a subdirectory of
dirwithsubPathLengthchars - Throws:
IOException- If unable to perform this check
-