def HandleLocalTransferRequest(self, request, response):
    """Handles Local Transferring request.

    Args:
      request: request object.
      response: response object.
    Raises:
      StreamPushServeException
    """
    logger.debug("HandleLocalTransferRequest...")
    src_path = request.GetParameter(constants.FILE_PATH)
    dest_path = request.GetParameter(constants.DEST_FILE_PATH)

    if (not src_path) or (not dest_path):
      raise exceptions.StreamPushServeException(
          "HandleLocalTransferRequest: Missing src/dest paths.")

    src_path = os.path.normpath(src_path)
    dest_path = os.path.normpath(dest_path)
    logger.debug("HandleLocalTransferRequest: %s to %s", src_path, dest_path)

    force_copy = request.IsForceCopy()
    prefer_copy = request.IsPreferCopy()
    if serve_utils.LocalTransfer(src_path, dest_path,
                                 force_copy, prefer_copy, self._allow_symlinks):
      http_io.ResponseWriter.AddBodyElement(
          response, constants.HDR_STATUS_CODE, constants.STATUS_SUCCESS)
    else:
      raise exceptions.StreamPushServeException("Local transfer failed.")
    def _TransferPublishManifest(self, publish_manifest, db_path_prefix,
                                 force_copy):
        """Transfers publish manifest files into published database directory.

    Args:
      publish_manifest: publish manifest.
      db_path_prefix: database path prefix.
      force_copy: whether to force a copy.
    Raises:
      exceptions.PublishServeException
    """
        for item in publish_manifest:
            src_path = item.current_path
            dest_path = "%s/%s" % (db_path_prefix, item.orig_path)
            logger.debug(
                "TransferPublishManifest - src_path: %s, dest_path: %s.",
                src_path, dest_path)

            # Transfer manifest file to published database directory.
            tries = 2
            sleep_secs = 5
            while (not serve_utils.LocalTransfer(src_path,
                                                 dest_path,
                                                 force_copy,
                                                 prefer_copy=True,
                                                 allow_symlinks=False)):
                tries -= 1
                if tries == 0:
                    raise exceptions.PublishServeException(
                        "Could not transfer publish manifest file %s to %s." %
                        (src_path, dest_path))
                logger.debug("Retrying Local Transfer.")
                time.sleep(sleep_secs)
                sleep_secs *= 2  # Double the sleep time after each retry.