/** * Performs a POST on an URL, checks the response code and returns the * result. */ protected void postAndConsume(UrlBuilder url, String contentType, Output writer) { Response resp = post(url, contentType, writer); IOUtils.consumeAndClose(resp.getStream()); }
/** * Performs a POST on an URL, checks the response code and returns the * result. */ protected void postAndConsume(UrlBuilder url, String contentType, Output writer) { Response resp = post(url, contentType, writer); IOUtils.consumeAndClose(resp.getStream()); }
/** * Performs a POST on an URL, checks the response code and consumes the * response. */ protected void postAndConsume(UrlBuilder url, String contentType, Output writer) { Response resp = post(url, contentType, writer); IOUtils.consumeAndClose(resp.getStream()); }
IOUtils.consumeAndClose(stream);
IOUtils.consumeAndClose(stream);
throw new CmisOAuthException("Parsing the OAuth token response failed: " + pe.getMessage(), pe); } finally { IOUtils.consumeAndClose(reader); if (reader == null) { IOUtils.closeQuietly(stream);
throw new CmisOAuthException("Parsing the OAuth token response failed: " + pe.getMessage(), pe); } finally { IOUtils.consumeAndClose(reader); if (reader == null) { IOUtils.closeQuietly(stream);
/** * Parses an input stream. */ protected Object parse(InputStream stream, String charset, ContainerFactory containerFactory) { InputStreamReader reader = null; Object obj = null; try { reader = new InputStreamReader(stream, charset); JSONParser parser = new JSONParser(); obj = parser.parse(reader, containerFactory); } catch (JSONParseException e) { throw new CmisConnectionException("Parsing exception: " + e.getMessage(), e); } catch (Exception e) { throw new CmisConnectionException("Parsing exception!", e); } finally { IOUtils.consumeAndClose(reader); if (reader == null) { IOUtils.closeQuietly(stream); } } return obj; }
/** * Parses an input stream. */ protected Object parse(InputStream stream, String charset, ContainerFactory containerFactory) { InputStreamReader reader = null; Object obj = null; try { reader = new InputStreamReader(stream, charset); JSONParser parser = new JSONParser(); obj = parser.parse(reader, containerFactory); } catch (JSONParseException e) { throw new CmisConnectionException("Parsing exception: " + e.getMessage(), e); } catch (Exception e) { throw new CmisConnectionException("Parsing exception!", e); } finally { IOUtils.consumeAndClose(reader); if (reader == null) { IOUtils.closeQuietly(stream); } } return obj; }
assertNotNull(contentStream, null, f); IOUtils.consumeAndClose(contentStream.getStream()); } catch (Exception e) { addResult(createResult(WARNING, "The name '" + NAMES[i] + "' raised this exception: " + e, e, false));