private Response getWorkflowResponse(String filePath, String responseType,
                                       boolean olderFormatDraftIngored) throws IOException {
    final InputStream is = workflowFilesService.readWorkflowXml(filePath);
    StreamingOutput streamer = utils.streamResponse(is);
    Response.ResponseBuilder responseBuilder = Response.ok(streamer).header(RESPONSE_TYPE, responseType);
    if (olderFormatDraftIngored) {
      responseBuilder.header(OLDER_FORMAT_DRAFT_INGORED, Boolean.TRUE.toString());
    }
    return responseBuilder.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