How to use the @jupyterlab/docmanager.shouldOverwrite function in @jupyterlab/docmanager

To help you get started, we’ve selected a few @jupyterlab/docmanager examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jupyterlab / jupyterlab-data-explorer / packages / filebrowser / src / model.ts View on Github external
file.name
      }`;
      console.warn(msg);
      throw msg;
    }

    const err = 'File not uploaded';
    if (largeFile && !(await this._shouldUploadLarge(file))) {
      throw 'Cancelled large file upload';
    }
    await this._uploadCheckDisposed();
    await this.refresh();
    await this._uploadCheckDisposed();
    if (
      find(this._items, i => i.name === file.name) &&
      !(await shouldOverwrite(file.name))
    ) {
      throw err;
    }
    await this._uploadCheckDisposed();
    const chunkedUpload = supportsChunked && file.size > CHUNK_SIZE;
    return await this._upload(file, chunkedUpload);
  }
github jupyterlab / jupyterlab-data-explorer / jupyterlab / packages / filebrowser / src / model.ts View on Github external
file.name
      }`;
      console.warn(msg);
      throw msg;
    }

    const err = 'File not uploaded';
    if (largeFile && !(await this._shouldUploadLarge(file))) {
      throw 'Cancelled large file upload';
    }
    await this._uploadCheckDisposed();
    await this.refresh();
    await this._uploadCheckDisposed();
    if (
      find(this._items, i => i.name === file.name) &&
      !(await shouldOverwrite(file.name))
    ) {
      throw err;
    }
    await this._uploadCheckDisposed();
    const chunkedUpload = supportsChunked && file.size > CHUNK_SIZE;
    return await this._upload(file, chunkedUpload);
  }
github jupyterlab / jupyterlab / packages / filebrowser / src / model.ts View on Github external
return this.refresh().then(() => {
      if (this.isDisposed) {
        return Promise.resolve(false);
      }
      let item = find(this._items, i => i.name === file.name);
      if (item) {
        return shouldOverwrite(file.name);
      }
      return Promise.resolve(true);
    }).then(value => {
      if (value) {
github jupyterlab / jupyterlab / packages / filebrowser / src / model.ts View on Github external
return this.refresh().then(() => {
      if (this.isDisposed) {
        return Promise.resolve(false);
      }
      let item = find(this._items, i => i.name === file.name);
      if (item) {
        return shouldOverwrite(file.name);
      }
      return Promise.resolve(true);
    }).then(value => {
      if (value) {