/** The http headers. */ public HttpFields getHeaders() throws IOException { ensureResponse(); return m_response.getHeaders(); }
/** * The http status code. */ public int getStatus() throws IOException { ensureResponse(); return m_response.getStatus(); }
/** * The http reason line. */ public String getReason() throws IOException { ensureResponse(); return m_response.getReason(); }
/** * Return the value of the <code>Content-Type</code> header. * @return * @throws IOException */ public String getContentType() throws IOException { ensureResponse(); final HttpFields headers = m_response.getHeaders(); return headers.get(HttpHeader.CONTENT_TYPE); }
@Override public InputStream getInputStream() { if (m_cachedStream != null) { /* * This preserves the semantics of the method on the base class * since Jetty will return a closed input stream if you invoke this * method more than once. */ return super.getInputStream(); } // await a response up to a timeout. try { ensureResponse(); } catch (IOException e) { throw new RuntimeException(e); } // request the input stream. m_cachedStream = super.getInputStream(); return m_cachedStream; }