@GET
  @Path("/readWorkflowXml")
  public Response readWorkflowXml(
    @QueryParam("workflowXmlPath") String workflowPath,@QueryParam("jobType") String jobTypeStr) {
    if (StringUtils.isEmpty(workflowPath)) {
      throw new WfmWebException(ErrorCode.INVALID_EMPTY_INPUT);
    }
    try {
      if (!hdfsFileUtils.fileExists(workflowPath)) {
        throw new WfmWebException(ErrorCode.WORKFLOW_XML_DOES_NOT_EXIST);
      }
      final InputStream is = workflowFilesService.readWorkflowXml(workflowPath);
      StreamingOutput streamer = utils.streamResponse(is);
      return Response.ok(streamer).status(200).build();
    } 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