private MediaItemSearchResponse listMediaItems(
          UUID jobId,
          TokensAndUrlAuthData authData,
          Optional<String> albumId,
          Optional<String> pageToken
  )
          throws FailedToListMediaItemsException {
    if (retryingExecutor == null || !enableRetrying) {
      try {
        return getOrCreatePhotosInterface(authData).listMediaItems(albumId, pageToken);
      } catch (IOException | InvalidTokenException | PermissionDeniedException | UploadErrorException e) {
        throw new FailedToListMediaItemsException(e.getMessage(), e);
      }
    }

    try {
      return retryingExecutor.executeOrThrowException(
              format("%s: listMediaItems(albumId=%s, page=%s)", jobId, albumId, pageToken),
              format("listMediaItems(albumId=%s, page=%s)", albumId, pageToken),
              () -> getOrCreatePhotosInterface(authData).listMediaItems(albumId, pageToken)
      );
    } catch (Exception e) {
      throw new FailedToListMediaItemsException(e.getMessage(), e);
    }
  }
Tries to call PhotosInterface.ListMediaItems, and retries on failure. If unsuccessful, throws a
FailedToListMediaItemsException.
extensions/data-transfer/portability-data-transfer-google/src/main/java/org/datatransferproject/datatransfer/google/media/GoogleMediaExporter.java