private String createUploadSession(
      DownloadableFile item, IdempotentImportExecutor idempotentImportExecutor)
      throws IOException, CopyExceptionWithFailureReason {
    Request.Builder createSessionRequestBuilder =
        buildCreateUploadSessionPath(item, idempotentImportExecutor);

    // Auth headers
    createSessionRequestBuilder.header("Authorization", "Bearer " + credential.getAccessToken());
    createSessionRequestBuilder.header("Content-Type", "application/json");

    // Post request with empty body. If you don't include an empty body, you'll have problems
    createSessionRequestBuilder.post(
        RequestBody.create(
            MediaType.parse("application/json"),
            objectMapper.writeValueAsString(ImmutableMap.of())));

    return tryWithCredsOrFail(
        createSessionRequestBuilder,
        "uploadUrl" /*jsonResponseKey*/,
        "creating initial upload session");
  }
Depletes input stream, uploading a chunk of the stream at a time, throwing a DTP exception
along the way if any unrecoverable errors are encountered.
extensions/data-transfer/portability-data-transfer-microsoft/src/main/java/org/datatransferproject/transfer/microsoft/media/MicrosoftMediaImporter.java