protected boolean isCompressingRequest(XmlRpcStreamRequestConfig pConfig) { return pConfig.isEnabledForExtensions() && pConfig.isGzipCompressing(); }
/** Called to prepare the output stream. Typically used for enabling * compression, or similar filters. * @param pConnection The connection object. */ protected OutputStream getOutputStream(ServerStreamConnection pConnection, XmlRpcStreamRequestConfig pConfig, OutputStream pStream) throws IOException { if (pConfig.isEnabledForExtensions() && pConfig.isGzipRequesting()) { return new GZIPOutputStream(pStream); } else { return pStream; } }
protected void setCompressionHeaders(XmlRpcHttpClientConfig pConfig) { if (pConfig.isGzipCompressing()) { setRequestHeader("Content-Encoding", "gzip"); } if (pConfig.isGzipRequesting()) { setRequestHeader("Accept-Encoding", "gzip"); } }
protected boolean isCompressingRequest(XmlRpcStreamRequestConfig pConfig) { return pConfig.isEnabledForExtensions() && pConfig.isGzipCompressing(); }
protected boolean isResponseGzipCompressed(XmlRpcStreamRequestConfig pConfig) { return pConfig.isGzipRequesting(); }
/** Returns, whether the requests content length is required. */ protected boolean isContentLengthRequired(XmlRpcStreamRequestConfig pConfig) { if (!pConfig.isEnabledForExtensions()) { // The spec requires a content-length. return true; } boolean isRequired = !((XmlRpcHttpServerConfig) getConfig()).isContentLengthOptional(); if(pConfig instanceof XmlRpcHttpRequestConfig) { isRequired |= !((XmlRpcHttpRequestConfig)pConfig).isContentLengthOptional(); } return isRequired; }
map.put("faultString", pMessage == null ? "" : pMessage); if (pThrowable != null && extensions && (pConfig instanceof XmlRpcStreamRequestConfig) && ((XmlRpcStreamRequestConfig) pConfig).isEnabledForExceptions()) { try { ByteArrayOutputStream baos = new ByteArrayOutputStream();
protected Object readResponse(XmlRpcStreamRequestConfig pConfig, InputStream pStream) throws XmlRpcException { InputSource isource = new InputSource(pStream); isource.setEncoding(pConfig.getEncoding()); //jl XMLReader xr = newXMLReader(); XmlRpcResponseParser xp; try { xp = new XmlRpcResponseParser(pConfig, getClient().getTypeFactory()); xr.setContentHandler(xp); xr.parse(isource); } catch (SAXException e) { throw new XmlRpcClientException("Failed to parse server's response: " + e.getMessage(), e); } catch (IOException e) { throw new XmlRpcClientException("Failed to read server's response: " + e.getMessage(), e); } if (xp.isSuccess()) { return xp.getResult(); } Throwable t = xp.getErrorCause(); if (t == null) { throw new XmlRpcException(xp.getErrorCode(), xp.getErrorMessage()); } if (t instanceof XmlRpcException) { throw (XmlRpcException) t; } if (t instanceof RuntimeException) { throw (RuntimeException) t; } throw new XmlRpcException(xp.getErrorCode(), xp.getErrorMessage(), t); } }
protected boolean isResponseGzipCompressed(XmlRpcStreamRequestConfig pConfig) { return pConfig.isGzipRequesting(); }
/** Returns, whether the requests content length is required. */ protected boolean isContentLengthRequired(XmlRpcStreamRequestConfig pConfig) { if (!pConfig.isEnabledForExtensions()) { // The spec requires a content-length. return true; } boolean isRequired = !((XmlRpcHttpServerConfig) getConfig()).isContentLengthOptional(); if(pConfig instanceof XmlRpcHttpRequestConfig) { isRequired |= !((XmlRpcHttpRequestConfig)pConfig).isContentLengthOptional(); } return isRequired; }
map.put("faultString", pMessage == null ? "" : pMessage); if (pThrowable != null && extensions && (pConfig instanceof XmlRpcStreamRequestConfig) && ((XmlRpcStreamRequestConfig) pConfig).isEnabledForExceptions()) { try { ByteArrayOutputStream baos = new ByteArrayOutputStream();
protected boolean isCompressingRequest(XmlRpcStreamRequestConfig pConfig) { return pConfig.isEnabledForExtensions() && pConfig.isGzipCompressing(); }
/** Called to prepare the output stream. Typically used for enabling * compression, or similar filters. * @param pConnection The connection object. */ protected OutputStream getOutputStream(ServerStreamConnection pConnection, XmlRpcStreamRequestConfig pConfig, OutputStream pStream) throws IOException { if (pConfig.isEnabledForExtensions() && pConfig.isGzipRequesting()) { return new GZIPOutputStream(pStream); } else { return pStream; } }
protected boolean isResponseGzipCompressed(XmlRpcStreamRequestConfig pConfig) { return pConfig.isGzipRequesting(); }
map.put("faultString", pMessage == null ? "" : pMessage); if (pThrowable != null && extensions && (pConfig instanceof XmlRpcStreamRequestConfig) && ((XmlRpcStreamRequestConfig) pConfig).isEnabledForExceptions()) { try { ByteArrayOutputStream baos = new ByteArrayOutputStream();
protected boolean isCompressingRequest(XmlRpcStreamRequestConfig pConfig) { return pConfig.isEnabledForExtensions() && pConfig.isGzipCompressing(); }
/** Called to prepare the output stream. Typically used for enabling * compression, or similar filters. * @param pConnection The connection object. */ protected OutputStream getOutputStream(ServerStreamConnection pConnection, XmlRpcStreamRequestConfig pConfig, OutputStream pStream) throws IOException { if (pConfig.isEnabledForExtensions() && pConfig.isGzipRequesting()) { return new GZIPOutputStream(pStream); } else { return pStream; } }
protected boolean isCompressingRequest(XmlRpcStreamRequestConfig pConfig) { return pConfig.isEnabledForExtensions() && pConfig.isGzipCompressing(); }
protected OutputStream getOutputStream(ServerStreamConnection pConnection, XmlRpcStreamRequestConfig pConfig, OutputStream pStream) throws IOException { if (pConfig.isEnabledForExtensions() && pConfig.isGzipRequesting()) { setResponseHeader(pConnection, "Content-Encoding", "gzip"); } return super.getOutputStream(pConnection, pConfig, pStream); } }
protected InputStream getInputStream(XmlRpcStreamRequestConfig pConfig, ServerStreamConnection pConnection) throws IOException { InputStream istream = pConnection.newInputStream(); if (pConfig.isEnabledForExtensions() && pConfig.isGzipCompressing()) { istream = new GZIPInputStream(istream); } return istream; }