public @NotNull Promise<VirtualFile> download() {
    synchronized (myLock) {
      return switch (getState()) {
        case DOWNLOADING_NOT_STARTED -> {
          startDownloading();
          yield createDownloadedCallback(this);
        }
        case DOWNLOADING_IN_PROGRESS -> createDownloadedCallback(this);
        case DOWNLOADED -> Promises.resolvedPromise(myLocalVirtualFile);
        case ERROR_OCCURRED -> rejectedPromise("errorOccurred");
      };
    }
  }
public @NotNull Promise<VirtualFile> download()