Options
All
  • Public
  • Public/Protected
  • All
Menu

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

  • IDisposable

Index

Constructors

constructor

  • Construct a new file browser model.

    Parameters

    Returns FileBrowserModel

Properties

Private _connectionFailure

_connectionFailure: any

Private _driveName

_driveName: any

Private _fileChanged

_fileChanged: any

Private _handleContents

_handleContents: any

Handle an updated contents model.

Private _isDisposed

_isDisposed: any

Private _items

_items: any

Private _key

_key: any

Private _model

_model: any

Private _onFileChanged

_onFileChanged: any

Handle a change on the contents manager.

Private _onRunningChanged

_onRunningChanged: any

Handle a change to the running sessions.

Private _pathChanged

_pathChanged: any

Private _paths

_paths: any

Private _pending

_pending: any

Private _pendingPath

_pendingPath: any

Private _poll

_poll: any

Private _populateSessions

_populateSessions: any

Populate the model's sessions collection.

Private _refreshed

_refreshed: any

Private _restored

_restored: any

Private _sessions

_sessions: any

Private _shouldUploadLarge

_shouldUploadLarge: any

Private _state

_state: any

Private _trans

_trans: any

Private _unloadEventListener

_unloadEventListener: any

Private _upload

_upload: any

Perform the actual upload.

Private _uploadChanged

_uploadChanged: any

Private _uploadCheckDisposed

_uploadCheckDisposed: any

Private _uploads

_uploads: any

Readonly manager

The document manager instance used by the file browser model.

Protected translator

translator: ITranslator

Accessors

connectionFailure

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

    Returns ISignal<this, Error>

driveName

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

    Returns string

fileChanged

  • Get the file path changed signal.

    Returns ISignal<this, IChangedArgs>

isDisposed

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

    Returns boolean

path

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

    Returns string

pathChanged

  • A signal emitted when the path changes.

    Returns ISignal<this, IChangedArgs<string>>

refreshed

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

    Returns ISignal<this, void>

restored

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

    Returns Promise<void>

specs

  • Get the kernel spec models.

    Returns ISpecModels | null

uploadChanged

  • A signal emitted when an upload progresses.

    Returns ISignal<this, IChangedArgs<IUploadModel | null>>

Methods

cd

  • cd(newValue?: string): Promise<void>
  • Change directory.

    Parameters

    • Optional newValue: string

    Returns Promise<void>

    A promise with the contents of the directory.

dispose

  • dispose(): void
  • Dispose of the resources held by the model.

    Returns void

download

  • download(path: string): Promise<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.

items

  • Create an iterator over the model's items.

    Returns IIterator<IModel>

    A new iterator over the model's items.

refresh

  • refresh(): Promise<void>
  • Force a refresh of the directory contents.

    Returns Promise<void>

restore

  • restore(id: string, populate?: boolean): 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.

sessions

  • sessions(): IIterator<IModel>
  • Create an iterator over the active sessions in the directory.

    Returns IIterator<IModel>

    A new iterator over the model's active sessions.

upload

  • upload(file: File): Promise<IModel>
  • Upload a File object.

    Parameters

    • file: File

      The File object to upload.

    Returns Promise<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.

uploads

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

    Returns IIterator<IUploadModel>

Generated using TypeDoc