/** * Converts the representation to a string value. Be careful when using this * method as the conversion of large content to a string fully stored in * memory can result in OutOfMemoryErrors being thrown. * * @return The representation as a string value. */ public String getText() throws IOException { String result = null; if (isEmpty()) { result = ""; } else if (isAvailable()) { java.io.StringWriter sw = new java.io.StringWriter(); write(sw); sw.flush(); result = sw.toString(); } return result; }
/** * Converts the representation to a string value. Be careful when using this * method as the conversion of large content to a string fully stored in * memory can result in OutOfMemoryErrors being thrown. * * @return The representation as a string value. */ public String getText() throws IOException { String result = null; if (isEmpty()) { result = ""; } else if (isAvailable()) { java.io.StringWriter sw = new java.io.StringWriter(); write(sw); sw.flush(); result = sw.toString(); } return result; }
if (response.getEntity().isEmpty()) { response.getEntity().release(); } else if (response.getRequest().getMethod().equals(Method.HEAD)) {