private String importDownloadableItem(
      DownloadableFile item, UUID jobId, IdempotentImportExecutor idempotentImportExecutor)
      throws Exception {
    final long totalFileSize = discardForLength(jobFileStream.streamFile(item, jobId, jobStore));
    if (totalFileSize <= 0) {
      throw new IOException(
          String.format(
              "jobid %s hit empty unexpectedly empty (bytes=%d) download for file %s",
              jobId, totalFileSize, item.getFetchableUrl()));
    }
    try (InputStream fileStream = jobFileStream.streamFile(item, jobId, jobStore)) {
      String itemUploadUrl = createUploadSession(item, idempotentImportExecutor);

      MicrosoftApiResponse finalChunkResponse =
          uploadStreamInChunks(totalFileSize, itemUploadUrl, item.getMimeType(), fileStream);
      checkState(
          finalChunkResponse.isOkay(),
          "final chunk-upload response should have had an ID, but a non-OK response came back: %s",
          finalChunkResponse.toString());

      // get complete file response
      return finalChunkResponse.getJsonValue(
          objectMapper,
          "id",
          "final chunk-upload response should have had ID, but got empty HTTP response-body");
    }
  }
Returns a folder ID after asking Microsoft APIs to allocate one for the given album.
extensions/data-transfer/portability-data-transfer-microsoft/src/main/java/org/datatransferproject/transfer/microsoft/media/MicrosoftMediaImporter.java