@Test public void allowStringResponseBody() throws OAuthProblemException, OAuthSystemException, IOException { final OAuthResourceResponse resp = createBinaryResponse(STRING_BYTES); assertEquals("getBody() should return correct string", STRING, resp.getBody()); }
public String getBody() { if (bodyRetrieved && body == null) { throw new IllegalStateException("Cannot call getBody() after getBodyAsInputStream()"); } if (body == null) { try { body = OAuthUtils.saveStreamAsString(getBodyAsInputStream()); inputStream = null; } catch (IOException e) { LOG.error("Failed to convert InputStream to String", e); } } return body; }
OAuthResourceResponse extends OAuthClientResponse { public String getBody() { if (bodyRetrieved && body == null) { throw new IllegalStateException("Cannot call getBody() after getBodyAsInputStream()"); } if (body == null) { try { body = OAuthUtils.saveStreamAsString(getBodyAsInputStream()); inputStream = null; } catch (IOException e) { LOG.error("Failed to convert InputStream to String", e); } } return body; } }
OAuthResourceResponse extends OAuthClientResponse { public String getBody() { if (bodyRetrieved && body == null) { throw new IllegalStateException("Cannot call getBody() after getBodyAsInputStream()"); } if (body == null) { try { body = OAuthUtils.saveStreamAsString(getBodyAsInputStream()); inputStream = null; } catch (IOException e) { LOG.error("Failed to convert InputStream to String", e); } } return body; } OAuthResourceResponse(); }
OAuthResourceResponse extends OAuthClientResponse { public String getBody() { if (bodyRetrieved && body == null) { throw new IllegalStateException("Cannot call getBody() after getBodyAsInputStream()"); } if (body == null) { try { body = OAuthUtils.saveStreamAsString(getBodyAsInputStream()); inputStream = null; } catch (IOException e) { LOG.error("Failed to convert InputStream to String", e); } } return body; } OAuthResourceResponse(); String getBody(); int getResponseCode(); String getContentType(); Map<String, List<String>> getHeaders(); InputStream getBodyAsInputStream(); }
OAuthResourceResponse extends OAuthClientResponse { public String getBody() { if (bodyRetrieved && body == null) { throw new IllegalStateException("Cannot call getBody() after getBodyAsInputStream()"); } if (body == null) { try { body = OAuthUtils.saveStreamAsString(getBodyAsInputStream()); inputStream = null; } catch (IOException e) { LOG.error("Failed to convert InputStream to String", e); } } return body; } OAuthResourceResponse(); String getBody(); int getResponseCode(); String getContentType(); Map<String, List<String>> getHeaders(); InputStream getBodyAsInputStream();  }