PathResolver

com.github.cloudfiles.crypt.fs.resolver.PathResolver
trait PathResolver[ID, FILE <: File[ID], FOLDER <: Folder[ID]] extends AutoCloseable

A trait defining a component that can resolve paths on a file system with encrypted file and folder names.

In such a file system, resolving a path can become an expensive operation. Depending on the cryptographic algorithm in use, it may not be sufficient to just encrypt the path; if every encrypt operation yields different output, this does not help. It is then necessary to traverse the path to be resolved and find a match for all components.

This trait defines a generic signature for a resolve operation. There can be multiple implementations with different characteristics that support concrete use cases better or worse.

If a concrete ''PathResolver'' implementation requires some state to be managed, e.g. when a kind of cache is used, it may be necessary to free resources when the resolver is no longer needed. To make this possible, this trait extends ''AutoClosable''. It also provides an empty default implementation of the ''close()'' method.

Type parameters

FILE

the type of files

FOLDER

the type of folders

ID

the type of IDs used by the file system

Attributes

Graph
Supertypes
trait AutoCloseable
class Object
trait Matchable
class Any
Known subtypes
class PathComponentsResolver[ID, FILE, FOLDER]

Members list

Value members

Abstract methods

def resolve(components: Seq[String], fs: FileSystem[ID, FILE, FOLDER, FolderContent[ID, FILE, FOLDER]], cryptConfig: CryptConfig)(implicit system: ActorSystem[_]): Operation[ID]

Resolves a path (specified as a sequence of path components) against a file system. If this operation is successful, a ''Future'' with the ID of the element referenced by the path is returned.

Resolves a path (specified as a sequence of path components) against a file system. If this operation is successful, a ''Future'' with the ID of the element referenced by the path is returned.

Value parameters

components

the sequence of path components to resolve

cryptConfig

the cryptography-related configuration

fs

the ''FileSystem'' in which to resolve the path

system

the actor system

Attributes

Returns

an ''Operation'' with the result of the resolve operation

Concrete methods

override def close(): Unit

Frees up resources used by this object when it is no longer needed. This base implementation does nothing.

Frees up resources used by this object when it is no longer needed. This base implementation does nothing.

Attributes

Definition Classes
AutoCloseable