@Override protected String call(HttpURLConnection conn) throws IOException, OozieClientException { if ((conn.getResponseCode() == HttpURLConnection.HTTP_OK)) { String output = getReaderAsString(new InputStreamReader(conn.getInputStream()), -1); return output; } else { handleError(conn); } return null; }
@Override protected String call(HttpURLConnection conn) throws IOException, OozieClientException { String returnVal = null; if ((conn.getResponseCode() == HttpURLConnection.HTTP_OK)) { InputStream is = conn.getInputStream(); InputStreamReader isr = new InputStreamReader(is); try { if (printStream != null) { sendToOutputStream(isr, -1); } else { returnVal = getReaderAsString(isr, -1); } } finally { isr.close(); } } else { handleError(conn); } return returnVal; }
@Override protected String call(HttpURLConnection conn) throws IOException, OozieClientException { String returnVal = null; if ((conn.getResponseCode() == HttpURLConnection.HTTP_OK)) { InputStream is = conn.getInputStream(); try (InputStreamReader isr = new InputStreamReader(is, Charsets.UTF_8)) { if (printStream != null) { sendToOutputStream(isr, -1, printStream); } else { returnVal = getReaderAsString(isr, -1); } } } else { handleError(conn); } return returnVal; }
@Override protected String call(HttpURLConnection conn) throws IOException, OozieClientException { String returnVal = null; if ((conn.getResponseCode() == HttpURLConnection.HTTP_OK)) { InputStream is = conn.getInputStream(); try (InputStreamReader isr = new InputStreamReader(is, Charsets.UTF_8)) { if (printStream != null) { sendToOutputStream(isr, -1, printStream); } else { returnVal = getReaderAsString(isr, -1); } } } else { handleError(conn); } return returnVal; }