@POST
  @Path("/publishAsset")
  @Consumes({MediaType.TEXT_PLAIN + "," + MediaType.TEXT_XML})
  public Response publishAsset(String postBody, @Context HttpHeaders headers,
                               @Context UriInfo ui, @QueryParam("uploadPath") String uploadPath,
                               @DefaultValue("false") @QueryParam("overwrite") Boolean overwrite) {
    LOGGER.info("publish asset called");
    if (StringUtils.isEmpty(uploadPath)) {
      throw new WfmWebException(ErrorCode.INVALID_EMPTY_INPUT);
    }
    uploadPath = uploadPath.trim();
    try {
      Map<String, String> validateAsset = assetResource.validateAsset(headers, postBody,
        ui.getQueryParameters());
      if (!STATUS_OK.equals(validateAsset.get(STATUS_KEY))) {
        WfmWebException wfmEx=new WfmWebException(ErrorCode.INVALID_ASSET_INPUT);
        wfmEx.setAdditionalDetail(validateAsset.get(MESSAGE_KEY));
        throw wfmEx;
      }
      return saveAsset(postBody, uploadPath, overwrite);
    } catch (WfmWebException ex) {
      LOGGER.error(ex.getMessage(),ex);
      throw ex;
    } catch (Exception ex) {
      LOGGER.error(ex.getMessage(),ex);
      throw new WfmWebException(ex);
    }
  }
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