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

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

Hierarchy

Implemented by

Properties

contentProviderRegistry?: IContentProviderRegistry

An optional content provider registry, consisting of all the content providers that this drive can use to access files.

A signal emitted when a file operation takes place.

isDisposed: boolean

Test whether the object has been disposed.

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.

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

    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.

    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.