protected boolean isUsingByteArrayOutput(XmlRpcHttpClientConfig pConfig) { boolean result = super.isUsingByteArrayOutput(pConfig); if (!result) { throw new IllegalStateException("The Content-Length header is required with HTTP/1.0, and HTTP/1.1 is unsupported by the Lite HTTP Transport."); } return result; }
protected boolean isUsingByteArrayOutput(XmlRpcHttpClientConfig pConfig) { boolean result = super.isUsingByteArrayOutput(pConfig); if (!result) { throw new IllegalStateException("The Content-Length header is required with HTTP/1.0, and HTTP/1.1 is unsupported by the Lite HTTP Transport."); } return result; }
protected boolean isUsingByteArrayOutput(XmlRpcHttpClientConfig pConfig) { boolean result = super.isUsingByteArrayOutput(pConfig); if (!result) { throw new IllegalStateException("The Content-Length header is required with HTTP/1.0, and HTTP/1.1 is unsupported by the Lite HTTP Transport."); } return result; }
public void writeRequest(OutputStream pOut) throws IOException { try { /* Make sure, that the socket is not closed by replacing it with our * own BufferedOutputStream. */ OutputStream ostream; if (isUsingByteArrayOutput(config)) { // No need to buffer the output. ostream = new FilterOutputStream(pOut){ public void close() throws IOException { flush(); } }; } else { ostream = new BufferedOutputStream(pOut){ public void close() throws IOException { flush(); } }; } pWriter.write(ostream); } catch (XmlRpcException e) { throw new XmlRpcIOException(e); } catch (SAXException e) { throw new XmlRpcIOException(e); } } public long getContentLength() { return contentLength; }
protected ReqWriter newReqWriter(XmlRpcRequest pRequest) throws XmlRpcException, IOException, SAXException { final XmlRpcHttpClientConfig config = (XmlRpcHttpClientConfig) pRequest.getConfig(); if (isUsingByteArrayOutput(config)) { ByteArrayReqWriter reqWriter = new ByteArrayReqWriter(pRequest); setContentLength(reqWriter.getContentLength()); if (isCompressingRequest(config)) { return new GzipReqWriter(reqWriter); } return reqWriter; } else { return super.newReqWriter(pRequest); } } }
protected ReqWriter newReqWriter(XmlRpcRequest pRequest) throws XmlRpcException, IOException, SAXException { final XmlRpcHttpClientConfig config = (XmlRpcHttpClientConfig) pRequest.getConfig(); if (isUsingByteArrayOutput(config)) { ByteArrayReqWriter reqWriter = new ByteArrayReqWriter(pRequest); setContentLength(reqWriter.getContentLength()); if (isCompressingRequest(config)) { return new GzipReqWriter(reqWriter); } return reqWriter; } else { return super.newReqWriter(pRequest); } } }
protected ReqWriter newReqWriter(XmlRpcRequest pRequest) throws XmlRpcException, IOException, SAXException { final XmlRpcHttpClientConfig config = (XmlRpcHttpClientConfig) pRequest.getConfig(); if (isUsingByteArrayOutput(config)) { ByteArrayReqWriter reqWriter = new ByteArrayReqWriter(pRequest); setContentLength(reqWriter.getContentLength()); if (isCompressingRequest(config)) { return new GzipReqWriter(reqWriter); } return reqWriter; } else { return super.newReqWriter(pRequest); } } }
protected ReqWriter newReqWriter(XmlRpcRequest pRequest) throws XmlRpcException, IOException, SAXException { final XmlRpcHttpClientConfig config = (XmlRpcHttpClientConfig) pRequest.getConfig(); if (isUsingByteArrayOutput(config)) { ByteArrayReqWriter reqWriter = new ByteArrayReqWriter(pRequest); setContentLength(reqWriter.getContentLength()); if (isCompressingRequest(config)) { return new GzipReqWriter(reqWriter); } return reqWriter; } else { return super.newReqWriter(pRequest); } } }