java.lang.Object
java.nio.file.FileSystem
org.cryptomator.cryptofs.CryptoFileSystem
- All Implemented Interfaces:
Closeable,AutoCloseable
A
FileSystem which allows access to encrypted data in a directory.
A CryptoFileSystem encrypts/decrypts data read/stored from/to it and uses a storage location for the encrypted data. The storage location is denoted by a Path and can thus be any location
itself accessible via a java.nio.FileSystem.
A CryptoFileSystem can be used as any other java.nio.FileSystem, e.g. by using the operations from Files.
- Author:
- Markus Kreusch
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionabstract PathgetCiphertextPath(Path cleartextPath) Provides thePathto the (data) ciphertext from a given cleartext path.abstract PathProvides thePathto the storage location of the vault - the location on the physical / delegate file system where encrypted data is stored.abstract CryptoFileSystemStatsgetStats()Provides file system performance statistics.Methods inherited from class java.nio.file.FileSystem
close, getFileStores, getPath, getPathMatcher, getRootDirectories, getSeparator, getUserPrincipalLookupService, isOpen, isReadOnly, newWatchService, provider, supportedFileAttributeViews
-
Method Details
-
getPathToVault
Provides thePathto the storage location of the vault - the location on the physical / delegate file system where encrypted data is stored.This path has been passed in during creation and does not belong to this
CryptoFileSystem. Thus this path can not be used in operations on thisCryptoFileSystem.- Returns:
- the
Pathto the directory containing the encrypted files.
-
getCiphertextPath
Provides thePathto the (data) ciphertext from a given cleartext path.- Parameters:
cleartextPath- absolute path to the cleartext file or folder belonging to thisCryptoFileSystem. Internally the path must be an instance ofCryptoPath- Returns:
- the
Pathto ciphertext file or folder containing teh actual encrypted data - Throws:
ProviderMismatchException- if the cleartext path does not belong to this CryptoFileSystemNoSuchFileException- if for the cleartext path no ciphertext resource existsIOException- if an I/O error occurs looking for the ciphertext resource
-
getStats
Provides file system performance statistics.- Returns:
- the
CryptoFileSystemStatscontaining performance statistics for thisCryptoFileSystem
-