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 (view full)

Implements

Constructors

Properties

_connectionFailure: Signal<FileBrowserModel, Error> = ...
_driveName: string
_isDisposed: boolean = false
_items: Contents.IModel[] = []
_key: string = ''
_pathChanged: Signal<FileBrowserModel, IChangedArgs<string, string, string>> = ...
_paths: Set<string> = ...
_pending: null | Promise<void> = null
_pendingPath: null | string = null
_poll: Poll<any, any, "standby">
_refreshed: Signal<FileBrowserModel, void> = ...
_restored: PromiseDelegate<void> = ...
_sessions: Session.IModel[] = []
_state: null | IStateDB<ReadonlyPartialJSONValue> = null
_unloadEventListener: ((e) => undefined | string)

Type declaration

    • (e): undefined | string
    • Parameters

      Returns undefined | string

_uploadChanged: Signal<FileBrowserModel, IChangedArgs<null | IUploadModel, null | IUploadModel, string>> = ...
_uploads: IUploadModel[] = []

The document manager instance used by the file browser model.

translator: ITranslator

Accessors

Methods

  • Restore the state of the file browser.

    Parameters

    • id: string

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

    • populate: boolean = true

      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.

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