class ContentUploadServiceImpl extends BaseApiService<CloudSearch> implements ContentUploadService {

  @Override
  public ListenableFuture<Void> uploadContent(
      String resourceName, AbstractInputStreamContent content) throws IOException {
    checkArgument(!Strings.isNullOrEmpty(resourceName), "resource name can not be empty");
    checkNotNull(content, "content can not be null");
    checkState(isRunning(), "upload service not running to accept upload requests");
    Upload upload =
        service.media().upload(resourceName, new Media().setResourceName(resourceName), content);
    mediaUploader.enableMediaUploader(upload);
    return executorService.submit(
        () -> {
          upload.executeUnparsed();
          return null;
        });
  }

  private  ContentUploadServiceImpl(Builder builder);

}