code: private void duplicateContent(final String spaceId,
                                    final String contentId,
                                    final String sourceChecksum,
                                    final Map<String, String> sourceProperties)
          throws TaskExecutionFailedException {
          log.info("Duplicating " + contentId + " in space " + spaceId +
                   " in account " + dupTask.getAccount());
  
          ChecksumUtil checksumUtil = new ChecksumUtil(MD5);
          boolean localChecksumMatch = false;
          int attempt = 0;
  
          File localFile = null;
          while (!localChecksumMatch && attempt < 3) {
              // Get content stream
              try (InputStream sourceStream = getSourceContent(spaceId, contentId)) {
                  // Cache content locally
                  localFile = cacheContent(sourceStream);
                  // Check content
                  String localChecksum = checksumUtil.generateChecksum(localFile);
                  if (sourceChecksum.equals(localChecksum)) {
                      localChecksumMatch = true;
                  } else {
                      cleanup(localFile);
                  }
              } catch (Exception e) {
                  log.warn("Error generating checksum for source content: " + e.getMessage(), e);
              }
              attempt++;
          }
  
          // Put content
          if (localChecksumMatch) {
              putDestinationContent(spaceId,
                                    contentId,
                                    sourceChecksum,
                                    sourceProperties,
                                    localFile);
              log.info(
                  "Successfully duplicated id={} dup_size={} space={} account={}",
                  contentId,
                  localFile.length(),
                  spaceId, dupTask.getAccount());
          } else {
              cleanup(localFile);
              String msg = "Unable to retrieve content which matches the" +
                           " expected source checksum of: " + sourceChecksum;
              throw new DuplicationTaskExecutionFailedException(buildFailureMessage(msg));
          }
          cleanup(localFile);
      }
docs: Copies a content item from the source store to the destination store
  
  @param spaceId
  @param contentId