Interface: IContents

contents.IContents

The interface for the contents service.

Hierarchy

  • IManager

    IContents

Properties

fileChanged

Readonly fileChanged: ISignal<IManager, IChangedArgs>

A signal emitted when a file operation takes place.

Inherited from

Contents.IManager.fileChanged

Defined in

node_modules/@jupyterlab/services/lib/contents/index.d.ts:166


isDisposed

Readonly isDisposed: boolean

Test whether the object has been disposed.

Notes

This property is always safe to access.

Inherited from

Contents.IManager.isDisposed

Defined in

node_modules/@lumino/disposable/types/index.d.ts:13


serverSettings

Readonly serverSettings: ISettings

The server settings associated with the manager.

Inherited from

Contents.IManager.serverSettings

Defined in

node_modules/@jupyterlab/services/lib/contents/index.d.ts:170

Methods

addDrive

addDrive(drive): void

Add an IDrive to the manager.

Parameters

Name

Type

drive

IDrive

Returns

void

Inherited from

Contents.IManager.addDrive

Defined in

node_modules/@jupyterlab/services/lib/contents/index.d.ts:174


copy

copy(path, toDir): Promise<IModel>

Copy a file into a given directory.

Parameters

Name

Type

Description

path

string

The original file path.

toDir

string

The destination directory path.

Returns

Promise<IModel>

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

Inherited from

Contents.IManager.copy

Defined in

node_modules/@jupyterlab/services/lib/contents/index.d.ts:291


createCheckpoint

createCheckpoint(path): Promise<ICheckpointModel>

Create a checkpoint for a file.

Parameters

Name

Type

Description

path

string

The path of the file.

Returns

Promise<ICheckpointModel>

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

Inherited from

Contents.IManager.createCheckpoint

Defined in

node_modules/@jupyterlab/services/lib/contents/index.d.ts:300


delete

delete(path): Promise<void>

Delete a file.

Parameters

Name

Type

Description

path

string

The path to the file.

Returns

Promise<void>

A promise which resolves when the file is deleted.

Inherited from

Contents.IManager.delete

Defined in

node_modules/@jupyterlab/services/lib/contents/index.d.ts:258


deleteCheckpoint

deleteCheckpoint(path, checkpointID): Promise<void>

Delete a checkpoint for a file.

Parameters

Name

Type

Description

path

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.

Inherited from

Contents.IManager.deleteCheckpoint

Defined in

node_modules/@jupyterlab/services/lib/contents/index.d.ts:329


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

Inherited from

Contents.IManager.dispose

Defined in

node_modules/@lumino/disposable/types/index.d.ts:25


driveName

driveName(path): string

Given a path of the form drive:local/portion/of/it.txt get the name of the drive. If the path is missing a drive portion, returns an empty string.

Parameters

Name

Type

path

string

Returns

string

The drive name for the path, or the empty string.

Inherited from

Contents.IManager.driveName

Defined in

node_modules/@jupyterlab/services/lib/contents/index.d.ts:215


get

get(path, options?): Promise<IModel>

Get a file or directory.

Parameters

Name

Type

path

string

options?

IFetchOptions

Returns

Promise<IModel>

A promise which resolves with the file content.

Inherited from

Contents.IManager.get

Defined in

node_modules/@jupyterlab/services/lib/contents/index.d.ts:231


getDownloadUrl

getDownloadUrl(path): Promise<string>

Get an encoded download url given a file path.

Parameters

Name

Type

path

string

Returns

Promise<string>

Inherited from

Contents.IManager.getDownloadUrl

Defined in

node_modules/@jupyterlab/services/lib/contents/index.d.ts:241


getModelDBFactory

getModelDBFactory(path): null | IFactory

Given a path, get a ModelDB.IFactory from the relevant backend. Returns null if the backend does not provide one.

Parameters

Name

Type

path

string

Returns

null | IFactory

Inherited from

Contents.IManager.getModelDBFactory

Defined in

node_modules/@jupyterlab/services/lib/contents/index.d.ts:221


listCheckpoints

listCheckpoints(path): Promise<ICheckpointModel[]>

List available checkpoints for a file.

Parameters

Name

Type

Description

path

string

The path of the file.

Returns

Promise<ICheckpointModel[]>

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

Inherited from

Contents.IManager.listCheckpoints

Defined in

node_modules/@jupyterlab/services/lib/contents/index.d.ts:309


localPath

localPath(path): string

Given a path of the form drive:local/portion/of/it.txt get the local part of it.

Parameters

Name

Type

path

string

Returns

string

The local part of the path.

Inherited from

Contents.IManager.localPath

Defined in

node_modules/@jupyterlab/services/lib/contents/index.d.ts:183


newUntitled

newUntitled(options?): Promise<IModel>

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

Parameters

Name

Type

options?

ICreateOptions

Returns

Promise<IModel>

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

Inherited from

Contents.IManager.newUntitled

Defined in

node_modules/@jupyterlab/services/lib/contents/index.d.ts:250


normalize

normalize(path): string

Normalize a global path. Reduces ‘..’ and ‘.’ parts, and removes leading slashes from the local part of the path, while retaining the drive name if it exists.

Parameters

Name

Type

path

string

Returns

string

The normalized path.

Inherited from

Contents.IManager.normalize

Defined in

node_modules/@jupyterlab/services/lib/contents/index.d.ts:193


rename

rename(path, newPath): Promise<IModel>

Rename a file or directory.

Parameters

Name

Type

Description

path

string

The original file path.

newPath

string

The new file path.

Returns

Promise<IModel>

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

Inherited from

Contents.IManager.rename

Defined in

node_modules/@jupyterlab/services/lib/contents/index.d.ts:269


resolvePath

resolvePath(root, path): string

Resolve a global path, starting from the root path. Behaves like posix-path.resolve, with 3 differences:

  • will never prepend cwd

  • if root has a drive name, the result is prefixed with “:”

  • before adding drive name, leading slashes are removed

Parameters

Name

Type

root

string

path

string

Returns

string

The normalized path.

Inherited from

Contents.IManager.resolvePath

Defined in

node_modules/@jupyterlab/services/lib/contents/index.d.ts:205


restoreCheckpoint

restoreCheckpoint(path, checkpointID): Promise<void>

Restore a file to a known checkpoint state.

Parameters

Name

Type

Description

path

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.

Inherited from

Contents.IManager.restoreCheckpoint

Defined in

node_modules/@jupyterlab/services/lib/contents/index.d.ts:319


save

save(path, options?): Promise<IModel>

Save a file.

Parameters

Name

Type

Description

path

string

The desired file path.

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.

Inherited from

Contents.IManager.save

Defined in

node_modules/@jupyterlab/services/lib/contents/index.d.ts:280