private Response saveAsset(String postBody, String uploadPath, Boolean overwrite) throws IOException {
    uploadPath = workflowFilesService.getAssetFileName(uploadPath);
    if (!overwrite) {
      boolean fileExists = hdfsFileUtils.fileExists(uploadPath);
      if (fileExists) {
        throw new WfmWebException(ErrorCode.WORKFLOW_PATH_EXISTS);
      }
    }
    postBody = utils.formatXml(postBody);
    String filePath = workflowFilesService.createAssetFile(uploadPath, postBody, overwrite);
    LOGGER.info(String.format("publish asset job done. filePath=[%s]", filePath));
    return Response.ok().build();
  }
This is a class used to bridge the communication between the and the Oozie
API executing inside ambari.
contrib/views/wfmanager/src/main/java/org/apache/oozie/ambari/view/OozieProxyImpersonator.java