A file system extension that automatically encrypts the names of files and folders stored in an underlying file system.
When new files or folders are created, their names are encrypted using the configured CryptAlgorithm and encryption key. Analogously, when files or folders are resolved, or the content of a folder is requested, the names are again decrypted. When used together with CryptContentFileSystem both the names and content of files gets encrypted, which is a rather secure storage form.
For file systems with encrypted names, resolving a path becomes difficult, especially if encrypting a string twice with the algorithm in use does not necessarily yield the same result. To be flexible, such operations are delegated to a PathResolver object, which can be passed to the constructor. It is then possible to choose a specific resolver implementation that fits the usage scheme of the file system best.
Type parameters
- FILE
-
the type to represent a file
- FOLDER
-
the type to represent a folder
- ID
-
the type of element IDs
Value parameters
- delegate
-
the underlying file system
- namesConfig
-
the configuration for this file system
- resolver
-
the object that handles path resolve operations
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait DelegateFileSystem[ID, FILE, FOLDER]trait ExtensibleFileSystem[ID, FILE, FOLDER, FolderContent[ID, FILE, FOLDER]]trait FileSystem[ID, FILE, FOLDER, FolderContent[ID, FILE, FOLDER]]trait AutoCloseableclass Objecttrait Matchableclass AnyShow all
Members list
Value members
Concrete methods
Frees up resources used by this object when it is no longer needed. This base implementation does nothing. This implementation invokes the ''close()'' function of the PathResolver used by this instance.
Frees up resources used by this object when it is no longer needed. This base implementation does nothing. This implementation invokes the ''close()'' function of the PathResolver used by this instance.
Attributes
- Definition Classes
-
DelegateFileSystem -> FileSystem -> AutoCloseable
Creates a file as a child of the given parent folder by uploading the file's content and setting some metadata attributes. The attributes to set are provided in form of a file object; typically some properties are mandatory, such as the file name and the file size. If the operation is successful, the ID of the new file is returned.
Creates a file as a child of the given parent folder by uploading the file's content and setting some metadata attributes. The attributes to set are provided in form of a file object; typically some properties are mandatory, such as the file name and the file size. If the operation is successful, the ID of the new file is returned.
This implementation encrypts the name of the file before delegating to the underlying file system.
Attributes
- Definition Classes
-
DelegateFileSystem -> FileSystem
Creates a folder as a child of the given parent folder. The attributes of the new folder are defined by the folder object provided. If the operation is successful, the ID of the new folder is returned.
Creates a folder as a child of the given parent folder. The attributes of the new folder are defined by the folder object provided. If the operation is successful, the ID of the new folder is returned.
This implementation encrypts the name of the folder before delegating to the underlying file system.
Attributes
- Definition Classes
-
DelegateFileSystem -> FileSystem
Returns an object describing the content of the folder with the given ID. This can be used to find the files and the folders that are the children of the folder with the ID specified.
Returns an object describing the content of the folder with the given ID. This can be used to find the files and the folders that are the children of the folder with the ID specified.
This implementation obtains the content of the selected folder from the underlying file system. It then returns a new content object with all element names decrypted.
Attributes
- Definition Classes
-
DelegateFileSystem -> FileSystem
Returns the file identified by the given ID.
Returns the file identified by the given ID.
This implementation obtains the file to be resolved from the underlying file system and then decrypts its name.
Attributes
- Definition Classes
-
DelegateFileSystem -> FileSystem
Returns the folder identified by the given ID.
Returns the folder identified by the given ID.
This implementation obtains the folder to be resolved from the underlying file system and then decrypts its name.
Attributes
- Definition Classes
-
DelegateFileSystem -> FileSystem
Resolves the ID of an element (file or folder) that is specified by its path. This function is analogous to ''resolvePathComponents()'', but the target element of the operation is identified by a URI-like path. It is assumed that the single components in this path are encoded as necessary to yield a valid URI.
Resolves the ID of an element (file or folder) that is specified by its path. This function is analogous to ''resolvePathComponents()'', but the target element of the operation is identified by a URI-like path. It is assumed that the single components in this path are encoded as necessary to yield a valid URI.
This implementation splits the passed in path and delegates to ''resolvePathComponents()''.
Attributes
- Definition Classes
-
DelegateFileSystem -> FileSystem
Resolves the ID of an element (file or folder) that is specified by a sequence of path components. The components define the names of folders to traverse from the root in order to come to the target element. In a hierarchical file system, there is typically a direct relation between a path and a URI that uniquely identifies an element. But not all file systems are hierarchical; e.g. in Google Drive a single file can be contained in multiple folders, so a resolve operation can be actually complex. The single components passed to this function should be plain file or folder names; no encoding is expected. This implementation encodes the components and concatenates them to a path URI and invokes ''resolvePath()'' with this path.
Resolves the ID of an element (file or folder) that is specified by a sequence of path components. The components define the names of folders to traverse from the root in order to come to the target element. In a hierarchical file system, there is typically a direct relation between a path and a URI that uniquely identifies an element. But not all file systems are hierarchical; e.g. in Google Drive a single file can be contained in multiple folders, so a resolve operation can be actually complex. The single components passed to this function should be plain file or folder names; no encoding is expected. This implementation encodes the components and concatenates them to a path URI and invokes ''resolvePath()'' with this path.
This implementation tries to identify the single components in the path provided by requesting the root folder content and the contents of further folders in the sequence of components. The names in the folder content objects need to be decrypted first, so that they can be matched against the path components in the given sequence.
Attributes
- Definition Classes
-
DelegateFileSystem -> FileSystem
Inherited methods
Deletes the file with the given ID.
Deletes the file with the given ID.
Value parameters
- fileID
-
the ID of the file to delete
- system
-
the actor system
Attributes
- Returns
-
the ''Operation'' to delete the file
- Definition Classes
-
DelegateFileSystem -> FileSystem
- Inherited from:
- DelegateFileSystem
Deletes the folder with the given ID. Note that depending on the concrete implementation, it may be required that a folder is empty before it can be deleted. The root folder can typically not be deleted.
Deletes the folder with the given ID. Note that depending on the concrete implementation, it may be required that a folder is empty before it can be deleted. The root folder can typically not be deleted.
Value parameters
- folderID
-
the ID of the folder to delete
- system
-
the actor system
Attributes
- Returns
-
the ''Operation'' to delete a folder
- Definition Classes
-
DelegateFileSystem -> FileSystem
- Inherited from:
- DelegateFileSystem
Returns an entity for downloading the content of a file. The download can be performed by creating a stream with the data bytes of the resulting entity. Note that the entity must be consumed in all cases, either by running the stream with the data bytes or by discarding the bytes.
Returns an entity for downloading the content of a file. The download can be performed by creating a stream with the data bytes of the resulting entity. Note that the entity must be consumed in all cases, either by running the stream with the data bytes or by discarding the bytes.
Value parameters
- fileID
-
the ID of the file affected
- system
-
the actor system
Attributes
- Returns
-
the ''Operation'' to obtain an entity for downloading a file
- Definition Classes
-
DelegateFileSystem -> FileSystem
- Inherited from:
- DelegateFileSystem
Constructs an implementation specific file object based on the properties of the given source file with the given patch specification applied. This allows components that extend the functionality of a ''FileSystem'' to manipulate the attributes of a file without having to know the concrete implementation class.
Constructs an implementation specific file object based on the properties of the given source file with the given patch specification applied. This allows components that extend the functionality of a ''FileSystem'' to manipulate the attributes of a file without having to know the concrete implementation class.
Value parameters
- source
-
the source file
- spec
-
the ''ElementPatchSpec'' to manipulate properties
Attributes
- Returns
-
the resulting file object
- Definition Classes
-
DelegateFileSystem -> ExtensibleFileSystem
- Inherited from:
- DelegateFileSystem
Constructs an implementation-specific folder object based on the properties of the given source folder with the given patch specification applied. This allows components that extend the functionality of a ''FileSystem'' to manipulate the attributes of a folder without having to know the concrete implementation class.
Constructs an implementation-specific folder object based on the properties of the given source folder with the given patch specification applied. This allows components that extend the functionality of a ''FileSystem'' to manipulate the attributes of a folder without having to know the concrete implementation class.
Value parameters
- source
-
the source folder
- spec
-
the ''ElementPatchSpec'' to manipulate properties
Attributes
- Returns
-
the resulting folder object
- Definition Classes
-
DelegateFileSystem -> ExtensibleFileSystem
- Inherited from:
- DelegateFileSystem
Returns the file object that is referenced by the path specified. This is a combination of resolving the path and obtaining the file with the resulting ID.
Returns the file object that is referenced by the path specified. This is a combination of resolving the path and obtaining the file with the resulting ID.
Value parameters
- path
-
the path of the desired file
- system
-
the actor system
Attributes
- Returns
-
the ''Operation'' to resolve the file with this path
- Inherited from:
- FileSystem
Returns the folder object that is referenced by the path specified. This is a combination of resolving the path and obtaining the folder with the resulting ID.
Returns the folder object that is referenced by the path specified. This is a combination of resolving the path and obtaining the folder with the resulting ID.
Value parameters
- path
-
the path to the desired folder
- system
-
the actor system
Attributes
- Returns
-
the ''Operation'' to resolve the folder with this path
- Inherited from:
- FileSystem
Returns an object with the content of the root folder. This is a combination of requesting the root folder ID and requesting the content of this folder.
Returns an object with the content of the root folder. This is a combination of requesting the root folder ID and requesting the content of this folder.
Value parameters
- system
-
the actor system
Attributes
- Returns
-
the ''Operation'' to obtain the content of the root folder
- Inherited from:
- FileSystem
Returns the ID of the root folder of this file system. This can be used as starting point to iterate over the content stored in the file system.
Returns the ID of the root folder of this file system. This can be used as starting point to iterate over the content stored in the file system.
Value parameters
- system
-
the actor system
Attributes
- Returns
-
the ''Operation'' returning the ID of the file system root
- Definition Classes
-
DelegateFileSystem -> FileSystem
- Inherited from:
- DelegateFileSystem
Updates the metadata of a file. The passed in file object must contain the ID of the file affected and the attributes to set.
Updates the metadata of a file. The passed in file object must contain the ID of the file affected and the attributes to set.
Value parameters
- file
-
the object representing the file
- system
-
the actor system
Attributes
- Returns
-
the ''Operation'' to update file metadata
- Definition Classes
-
DelegateFileSystem -> FileSystem
- Inherited from:
- DelegateFileSystem
Combines an operation to update the content of a file with an operation to update its metadata properties. This base implementation delegates to the corresponding functions (''updateFileContent()'' and ''updateFile()'') in series. Implementations that can combine these updates in a single operation should override this function. Depending on the concrete underlying file system, it may be necessary to specify the new file size in the passed in file object.
Combines an operation to update the content of a file with an operation to update its metadata properties. This base implementation delegates to the corresponding functions (''updateFileContent()'' and ''updateFile()'') in series. Implementations that can combine these updates in a single operation should override this function. Depending on the concrete underlying file system, it may be necessary to specify the new file size in the passed in file object.
Value parameters
- content
-
a source with the new content of the file
- file
-
a data object with the properties of the file to update
- system
-
the actor system
Attributes
- Returns
-
the ''Operation'' that does the combined update
- Inherited from:
- FileSystem
Updates the content of a file by uploading new data to the server.
Updates the content of a file by uploading new data to the server.
Value parameters
- content
-
a ''Source'' with the content of the file
- fileID
-
the ID of the file affected
- size
-
the size of the new content
- system
-
the actor system
Attributes
- Returns
-
the ''Operation'' to upload new file content
- Definition Classes
-
DelegateFileSystem -> FileSystem
- Inherited from:
- DelegateFileSystem
Updates the metadata of a folder. The passed in folder object must contain the ID of the folder affected and the attributes to update.
Updates the metadata of a folder. The passed in folder object must contain the ID of the folder affected and the attributes to update.
Value parameters
- folder
-
the object representing the folder
- system
-
the actor system
Attributes
- Returns
-
the ''Operation'' to update folder metadata
- Definition Classes
-
DelegateFileSystem -> FileSystem
- Inherited from:
- DelegateFileSystem
Concrete fields
Returns the ''FileSystem'' to which operations are delegated by default.
Returns the ''FileSystem'' to which operations are delegated by default.
Attributes
- Returns
-
the ''FileSystem'' to delegate to