Construct a new contents manager object.
The options used to initialize the object.
Private
_additionalPrivate
_defaultPrivate
_filePrivate
_isReadonly
serverThe server settings associated with the manager.
A signal emitted when a file operation takes place.
Test whether the manager has been disposed.
Private
_driveGiven 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.
@param path a path to a file.
@returns A tuple containing an IDrive
object for the path,
and a local path for that drive.
Private
_onRespond 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.
Private
_toGiven a drive and a local path, construct a fully qualified
path. The inverse of _driveForPath
.
an IDrive
.
the local path on the drive.
the fully qualified path.
Add an IDrive
to the manager.
Copy a file into a given directory.
The destination directory path.
A promise which resolves with the new contents model when the file is copied.
The server will select the name of the copied file.
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.
Given a path, get a shared model factory from the
relevant backend. Returns null
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.
Create a new untitled file or directory in the specified directory path.
The options used to create the file.
A promise which resolves with the created file content when the file is created.
Resolve a global path, starting from the root path. Behaves like posix-path.resolve, with 3 differences:
the path.
The normalized path.
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.