Class CryptoFileSystem

java.lang.Object
java.nio.file.FileSystem
org.cryptomator.cryptofs.CryptoFileSystem
All Implemented Interfaces:
Closeable, AutoCloseable

public abstract class CryptoFileSystem extends FileSystem
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 Details

    • getPathToVault

      public abstract Path getPathToVault()
      Provides the Path to 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 this CryptoFileSystem.

      Returns:
      the Path to the directory containing the encrypted files.
    • getCiphertextPath

      public abstract Path getCiphertextPath(Path cleartextPath) throws IOException
      Provides the Path to the (data) ciphertext from a given cleartext path.
      Parameters:
      cleartextPath - absolute path to the cleartext file or folder belonging to this CryptoFileSystem. Internally the path must be an instance of CryptoPath
      Returns:
      the Path to ciphertext file or folder containing teh actual encrypted data
      Throws:
      ProviderMismatchException - if the cleartext path does not belong to this CryptoFileSystem
      NoSuchFileException - if for the cleartext path no ciphertext resource exists
      IOException - if an I/O error occurs looking for the ciphertext resource
    • getStats

      public abstract CryptoFileSystemStats getStats()
      Provides file system performance statistics.
      Returns:
      the CryptoFileSystemStats containing performance statistics for this CryptoFileSystem