Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IDrive

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

Hierarchy

  • IDisposable
    • IDrive

Implemented by

Index

Properties

fileChanged

fileChanged: ISignal<IDrive, IChangedArgs>

A signal emitted when a file operation takes place.

Readonly isDisposed

isDisposed: boolean

Test whether the object has been disposed.

Notes

This property is always safe to access.

Optional Readonly modelDBFactory

modelDBFactory: IFactory

An optional ModelDB.IFactory instance for the drive.

Readonly name

name: string

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

Readonly serverSettings

serverSettings: ISettings

The server settings of the manager.

Methods

copy

  • copy(localPath: string, toLocalDir: string): Promise<IModel>
  • Copy a file into a given directory.

    Parameters

    • localPath: string

      The original file path.

    • toLocalDir: string

      The destination directory path.

    Returns Promise<IModel>

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

createCheckpoint

  • Create a checkpoint for a file.

    Parameters

    • localPath: string

      The path of the file.

    Returns Promise<ICheckpointModel>

    A promise which resolves with the new checkpoint model when the checkpoint is created.

delete

  • delete(localPath: string): Promise<void>
  • Delete a file.

    Parameters

    • localPath: string

      The path to the file.

    Returns Promise<void>

    A promise which resolves when the file is deleted.

deleteCheckpoint

  • deleteCheckpoint(localPath: string, checkpointID: string): Promise<void>
  • 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

  • dispose(): void
  • 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

  • Get a file or directory.

    Parameters

    Returns Promise<IModel>

    A promise which resolves with the file content.

getDownloadUrl

  • getDownloadUrl(localPath: string): Promise<string>
  • Get an encoded download url given a file path.

    Parameters

    • localPath: string

    Returns Promise<string>

listCheckpoints

  • List available checkpoints for a file.

    Parameters

    • localPath: string

      The path of the file.

    Returns Promise<ICheckpointModel[]>

    A promise which resolves with a list of checkpoint models for the file.

newUntitled

  • Create a new untitled file or directory in the specified directory path.

    Parameters

    Returns Promise<IModel>

    A promise which resolves with the created file content when the file is created.

rename

  • rename(oldLocalPath: string, newLocalPath: string): Promise<IModel>
  • Rename a file or directory.

    Parameters

    • oldLocalPath: string

      The original file path.

    • newLocalPath: string

      The new file path.

    Returns Promise<IModel>

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

restoreCheckpoint

  • restoreCheckpoint(localPath: string, checkpointID: string): Promise<void>
  • 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.

save

  • save(localPath: string, options?: Partial<IModel>): Promise<IModel>
  • Save a file.

    Parameters

    • localPath: string

      The desired file path.

    • Optional options: Partial<IModel>

      Optional overrides to the model.

    Returns Promise<IModel>

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

Generated using TypeDoc