A default implementation for an IDrive, talking to the server using the Jupyter REST API.

Hierarchy

  • Drive

Implements

Constructors

  • Construct a new contents manager object.

    Parameters

    • Optional options: Drive.IOptions

      The options used to initialize the object.

    Returns Drive

Properties

_apiEndpoint: any
_fileChanged: any
_getUrl: any

Get a REST url for a file given a path.

_isDisposed: any
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 drive.

Accessors

  • get isDisposed(): boolean
  • Test whether the manager has been disposed.

    Returns boolean

Methods

  • Copy a file into a given directory.

    Parameters

    • fromFile: string
    • toDir: string

      The destination directory path.

    Returns Promise<Contents.IModel>

    A promise which resolves with the new contents model when the file is copied.

    Notes

    The server will select the name of the copied file.

    Uses the Jupyter Server API and validates the response model.

  • Delete a file.

    Parameters

    • localPath: string

      The path to the file.

    Returns Promise<void>

    A promise which resolves when the file is deleted.

    Notes

    Uses the Jupyter Server API.

  • 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.

    Notes

    Uses the Jupyter Server API.

  • Dispose of the resources held by the manager.

    Returns void

  • Get an encoded download url given a file path.

    Parameters

    • localPath: string

      An absolute POSIX file path on the server.

      Notes

      It is expected that the path contains no relative paths.

      The returned URL may include a query parameter.

    Returns Promise<string>

  • Rename a file or directory.

    Parameters

    • oldLocalPath: string

      The original file path.

    • newLocalPath: string

      The new file path.

    Returns Promise<Contents.IModel>

    A promise which resolves with the new file contents model when the file is renamed.

    Notes

    Uses the Jupyter Server API and validates the response model.

  • 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.

    Notes

    Uses the Jupyter Server API.

  • Save a file.

    Parameters

    • localPath: string

      The desired file path.

    • Optional options: Partial<Contents.IModel>

      Optional overrides to the model.

    Returns Promise<Contents.IModel>

    A promise which resolves with the file content model when the file is saved.

    Notes

    Ensure that model.content is populated for the file.

    Uses the Jupyter Server API and validates the response model.

Generated using TypeDoc