The interface for a network drive that can be mounted in the contents manager.

interface IDrive {
    fileChanged: ISignal<IDrive, Contents.IChangedArgs>;
    isDisposed: boolean;
    name: string;
    serverSettings: ServerConnection.ISettings;
    sharedModelFactory?: ISharedFactory;
    copy(localPath, toLocalDir): Promise<Contents.IModel>;
    createCheckpoint(localPath): Promise<ICheckpointModel>;
    delete(localPath): Promise<void>;
    deleteCheckpoint(localPath, checkpointID): Promise<void>;
    dispose(): void;
    get(localPath, options?): Promise<Contents.IModel>;
    getDownloadUrl(localPath): Promise<string>;
    listCheckpoints(localPath): Promise<ICheckpointModel[]>;
    newUntitled(options?): Promise<Contents.IModel>;
    rename(oldLocalPath, newLocalPath): Promise<Contents.IModel>;
    restoreCheckpoint(localPath, checkpointID): Promise<void>;
    save(localPath, options?): Promise<Contents.IModel>;
}

Hierarchy

Implemented by

Properties

A signal emitted when a file operation takes place.

isDisposed: boolean

Test whether the object has been disposed.

Notes

This property is always safe to access.

name: string

The name of the drive, which is used at the leading component of file paths.

serverSettings: ServerConnection.ISettings

The server settings of the manager.

sharedModelFactory?: ISharedFactory

An optional shared model factory instance for the drive.

Methods

  • Delete a checkpoint for a file.

    Parameters

    • localPath: string

      The path of the file.

    • checkpointID: string

      The id of the checkpoint to delete.

    Returns Promise<void>

    A promise which resolves when the checkpoint is deleted.

  • Dispose of the resources held by the object.

    Notes

    If the object's dispose method is called more than once, all calls made after the first will be a no-op.

    Undefined Behavior

    It is undefined behavior to use any functionality of the object after it has been disposed unless otherwise explicitly noted.

    Returns void

  • Get an encoded download url given a file path.

    Parameters

    • localPath: string

    Returns Promise<string>

    A promise which resolves with the absolute POSIX file path on the server.

    Notes

    The returned URL may include a query parameter.

  • Restore a file to a known checkpoint state.

    Parameters

    • localPath: string

      The path of the file.

    • checkpointID: string

      The id of the checkpoint to restore.

    Returns Promise<void>

    A promise which resolves when the checkpoint is restored.