@Test(expected = InteroperabilityException.class) public void testClose() throws Exception { new DefaultStreamCloser().close(new HttpResponseOutputStream<Void>(new NullOutputStream()) { @Override public Void getStatus() throws BackgroundException { throw new InteroperabilityException("d"); } }); }
@Override public void close(final InputStream in) throws BackgroundException { if(null == in) { return; } try { in.close(); } catch(IOException e) { if(e.getCause() instanceof BackgroundException) { throw (BackgroundException) e.getCause(); } throw new DefaultIOExceptionMappingService().map(e); } }
DefaultStreamCloser implements StreamCloser { @Override public void close(final InputStream in) throws BackgroundException { if(null == in) { return; } try { in.close(); } catch(IOException e) { if(e.getCause() instanceof BackgroundException) { throw (BackgroundException) e.getCause(); } throw new DefaultIOExceptionMappingService().map(e); } } }
DefaultStreamCloser implements StreamCloser { @Override public void close(final InputStream in) throws BackgroundException { if(null == in) { return; } try { in.close(); } catch(IOException e) { if(e.getCause() instanceof BackgroundException) { throw (BackgroundException) e.getCause(); } throw new DefaultIOExceptionMappingService().map(e); } }  }
DefaultStreamCloser implements StreamCloser { @Override public void close(final InputStream in) throws BackgroundException { if(null == in) { return; } try { in.close(); } catch(IOException e) { if(e.getCause() instanceof BackgroundException) { throw (BackgroundException) e.getCause(); } throw new DefaultIOExceptionMappingService().map(e); } }  @Override void close(final InputStream in); @Override void close(final OutputStream out); }
DefaultStreamCloser implements StreamCloser { @Override public void close(final InputStream in) throws BackgroundException { if(null == in) { return; } try { in.close(); } catch(IOException e) { if(e.getCause() instanceof BackgroundException) { throw (BackgroundException) e.getCause(); } throw new DefaultIOExceptionMappingService().map(e); } }  @Override void close(final InputStream in); @Override void close(final OutputStream out);  }