Construct a new contents manager object.
The options used to initialize the object.
Given a path, get the IDrive to which it refers, where the path satisfies the pattern
'driveName:path/to/file'. If there is no
driveName`
prepended to the path, it returns the default drive.
Respond to fileChanged signals from the drives attached to the manager. This prepends the drive name to the path if necessary, and then forwards the signal.
Given a drive and a local path, construct a fully qualified
path. The inverse of _driveForPath
.
The server settings associated with the manager.
A signal emitted when a file operation takes place.
Test whether the manager has been disposed.
Add an IDrive
to the manager.
Create a checkpoint for a file.
The path of the file.
A promise which resolves with the new checkpoint model when the checkpoint is created.
Delete a file.
The path to the file.
A promise which resolves when the file is deleted.
Delete a checkpoint for a file.
The path of the file.
The id of the checkpoint to delete.
A promise which resolves when the checkpoint is deleted.
Dispose of the resources held by the manager.
Given a path of the form drive:local/portion/of/it.txt
get the name of the drive. If the path is missing
a drive portion, returns an empty string.
The drive name for the path, or the empty string.
Get a file or directory.
A promise which resolves with the file content.
Get an encoded download url given a file path.
An absolute POSIX file path on the server.
It is expected that the path contains no relative paths.
The returned URL may include a query parameter.
Given a path, get a ModelDB.IFactory from the
relevant backend. Returns undefined
if the backend
does not provide one.
List available checkpoints for a file.
The path of the file.
A promise which resolves with a list of checkpoint models for the file.
Given a path of the form drive:local/portion/of/it.txt
get the local part of it.
The local part of the path.
Create a new untitled file or directory in the specified directory path.
A promise which resolves with the created file content when the file is created.
Normalize a global path. Reduces '..' and '.' parts, and removes leading slashes from the local part of the path, while retaining the drive name if it exists.
The normalized path.
Rename a file or directory.
The original file path.
The new file path.
A promise which resolves with the new file contents model when the file is renamed.
Resolve a global path, starting from the root path. Behaves like posix-path.resolve, with 3 differences:
The normalized path.
Restore a file to a known checkpoint state.
The path of the file.
The id of the checkpoint to restore.
A promise which resolves when the checkpoint is restored.
Generated using TypeDoc
A contents manager that passes file operations to the server. Multiple servers implementing the
IDrive
interface can be attached to the contents manager, so that the same session can perform file operations on multiple backends.This includes checkpointing with the normal file operations.