All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.xmlrpc.server.XmlRpcHttpServer Maven / Gradle / Ivy

There is a newer version: 3.1.3
Show newest version
package org.apache.xmlrpc.server;

import java.io.IOException;
import java.io.OutputStream;

import org.apache.xmlrpc.common.ServerStreamConnection;
import org.apache.xmlrpc.common.XmlRpcStreamRequestConfig;



/** Abstract extension of {@link XmlRpcStreamServer} for deriving
 * HTTP servers.
 */
public abstract class XmlRpcHttpServer extends XmlRpcStreamServer {
	protected abstract void setResponseHeader(ServerStreamConnection pConnection, String pHeader, String pValue);

	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);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy