Repository: ambari Updated Branches: refs/heads/trunk b0fc5da42 -> aa974b0a7
AMBARI-20381. User is not able to import workflows, coordinators and bundles. (Padma Priya N. via dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/aa974b0a Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/aa974b0a Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/aa974b0a Branch: refs/heads/trunk Commit: aa974b0a72a07898c2762587738c7e497e0ac433 Parents: b0fc5da Author: Dipayan Bhowmick <dipayan.bhowm...@gmail.com> Authored: Fri Mar 10 15:24:12 2017 +0530 Committer: Dipayan Bhowmick <dipayan.bhowm...@gmail.com> Committed: Fri Mar 10 15:24:41 2017 +0530 ---------------------------------------------------------------------- .../org/apache/oozie/ambari/view/Utils.java | 51 +++++++++++--------- 1 file changed, 27 insertions(+), 24 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/aa974b0a/contrib/views/wfmanager/src/main/java/org/apache/oozie/ambari/view/Utils.java ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/java/org/apache/oozie/ambari/view/Utils.java b/contrib/views/wfmanager/src/main/java/org/apache/oozie/ambari/view/Utils.java index 8f427bd..1ff68c9 100644 --- a/contrib/views/wfmanager/src/main/java/org/apache/oozie/ambari/view/Utils.java +++ b/contrib/views/wfmanager/src/main/java/org/apache/oozie/ambari/view/Utils.java @@ -169,28 +169,31 @@ public class Utils { return false; } } - public StreamingOutput streamResponse(final InputStream is) { - return new StreamingOutput() { - @Override - public void write(OutputStream os) throws IOException, - WebApplicationException { - BufferedInputStream bis=new BufferedInputStream(is); - BufferedOutputStream bos=new BufferedOutputStream(os); - try { - int data; - while ((data = bis.read()) != -1) { - bos.write(data); - } - is.close(); - os.close(); - }catch (IOException e){ - LOGGER.error(e.getMessage(),e); - throw e; - }catch (Exception e){ - LOGGER.error(e.getMessage(),e); - throw new RuntimeException(e); - } - } - }; - } + + public StreamingOutput streamResponse(final InputStream is) { + return new StreamingOutput() { + @Override + public void write(OutputStream os) throws IOException, + WebApplicationException { + BufferedInputStream bis = new BufferedInputStream(is); + BufferedOutputStream bos = new BufferedOutputStream(os); + try { + int data; + while ((data = bis.read()) != -1) { + bos.write(data); + } + bos.flush(); + is.close(); + } catch (IOException e) { + LOGGER.error(e.getMessage(), e); + throw e; + } catch (Exception e) { + LOGGER.error(e.getMessage(), e); + throw new RuntimeException(e); + } finally { + bis.close(); + } + } + }; + } }