Class FileBrowserModel

An implementation of a file browser model.

Notes

All paths parameters without a leading '/' are interpreted as relative to the current directory. Supports '../' syntax.

Hierarchy

Implements

Constructors

Properties

_connectionFailure: any
_driveName: any
_fileChanged: any
_isDisposed: any
_items: any
_key: any
_model: any
_pathChanged: any
_paths: any
_pending: any
_pendingPath: any
_poll: any
_populateSessions: any

Populate the model's sessions collection.

_refreshed: any
_restored: any
_sessions: any
_shouldUploadLarge: any
_state: any
_trans: any
_unloadEventListener: any
_upload: any

Perform the actual upload.

_uploadChanged: any
_uploadCheckDisposed: any
_uploads: any

The document manager instance used by the file browser model.

translator: ITranslator

Accessors

  • get connectionFailure(): ISignal<this, Error>
  • A signal emitted when the file browser model loses connection.

    Returns ISignal<this, Error>

  • get driveName(): string
  • The drive name that gets prepended to the path.

    Returns string

  • get isDisposed(): boolean
  • Get whether the model is disposed.

    Returns boolean

  • get path(): string
  • Get the current path.

    Returns string

  • get pathChanged(): ISignal<this, IChangedArgs<string, string, string>>
  • A signal emitted when the path changes.

    Returns ISignal<this, IChangedArgs<string, string, string>>

  • get refreshed(): ISignal<this, void>
  • A signal emitted when the directory listing is refreshed.

    Returns ISignal<this, void>

  • get restored(): Promise<void>
  • A promise that resolves when the model is first restored.

    Returns Promise<void>

  • get rootPath(): string
  • Get the root path

    Returns string

  • get specs(): ISpecModels
  • Get the kernel spec models.

    Returns ISpecModels

Methods

  • Change directory.

    Parameters

    • Optional newValue: string

    Returns Promise<void>

    A promise with the contents of the directory.

  • Dispose of the resources held by the model.

    Returns void

  • Download a file.

    Parameters

    • path: string

      The path of the file to be downloaded.

    Returns Promise<void>

    A promise which resolves when the file has begun downloading.

  • Handle an updated contents model.

    Parameters

    Returns void

  • Create an iterator over the model's items.

    Returns IterableIterator<Contents.IModel>

    A new iterator over the model's items.

  • Handle a change on the contents manager.

    Parameters

    Returns void

  • Handle a change to the running sessions.

    Parameters

    Returns void

  • Force a refresh of the directory contents.

    Returns Promise<void>

  • Restore the state of the file browser.

    Parameters

    • id: string

      The unique ID that is used to construct a state database key.

    • Optional populate: boolean

      If false, the restoration ID will be set but the file browser state will not be fetched from the state database.

    Returns Promise<void>

    A promise when restoration is complete.

    Notes

    This function will only restore the model once. If it is called multiple times, all subsequent invocations are no-ops.

  • Create an iterator over the active sessions in the directory.

    Returns IterableIterator<Session.IModel>

    A new iterator over the model's active sessions.

  • Upload a File object.

    Parameters

    • file: File

      The File object to upload.

    Returns Promise<Contents.IModel>

    A promise containing the new file contents model.

    Notes

    On Notebook version < 5.1.0, this will fail to upload files that are too big to be sent in one request to the server. On newer versions, or on Jupyter Server, it will ask for confirmation then upload the file in 1 MB chunks.

  • Create an iterator over the status of all in progress uploads.

    Returns IterableIterator<IUploadModel>

Generated using TypeDoc