160161162163164165166167168169170
// read resource stream InputStream stream = method.getResponseBodyAsStream(); // a custom closer to ensure the method releases its connection CloseListener closer = new CloseListener() { public void close() { method.releaseConnection(); } };