[libxmlrpc3-java] 01/02: Transition to the Servlet API 3.1 (Closes: #801038)

Emmanuel Bourg ebourg-guest at moszumanska.debian.org
Thu Jun 23 10:56:48 UTC 2016


This is an automated email from the git hooks/post-receive script.

ebourg-guest pushed a commit to branch master
in repository libxmlrpc3-java.

commit 62bda4eafa4bbd8ada7ae63bfdeae6946a58f43b
Author: Emmanuel Bourg <ebourg at apache.org>
Date:   Thu Jun 23 12:27:05 2016 +0200

    Transition to the Servlet API 3.1 (Closes: #801038)
---
 debian/changelog                                  |   1 +
 debian/control                                    |   4 +-
 debian/maven.rules                                |   1 +
 debian/patches/02-servlet-api-compatibility.patch | 211 ++++++++++++++++++++++
 debian/patches/series                             |   1 +
 5 files changed, 216 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 724a496..4a134c6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,6 @@
 libxmlrpc3-java (3.1.3-8) UNRELEASED; urgency=medium
 
+  * Transition to the Servlet API 3.1 (Closes: #801038)
   * Build with the DH sequencer instead of CDBS
   * Standards-Version updated to 3.9.8
   * Moved the package to Git
diff --git a/debian/control b/debian/control
index a7b091d..71f4bfb 100644
--- a/debian/control
+++ b/debian/control
@@ -15,7 +15,7 @@ Build-Depends: debhelper (>= 9),
                libcommons-logging-java,
                libmaven-install-plugin-java,
                libmaven-javadoc-plugin-java,
-               libservlet2.5-java,
+               libservlet3.1-java,
                libws-commons-util-java,
                maven-debian-helper
 Standards-Version: 3.9.8
@@ -47,7 +47,7 @@ Description: XML-RPC implementation in Java (client side)
 Package: libxmlrpc3-server-java
 Architecture: all
 Depends: libcommons-logging-java,
-         libservlet2.5-java,
+         libservlet3.1-java,
          libxmlrpc3-common-java (= ${source:Version}),
          ${misc:Depends}
 Description: XML-RPC implementation in Java (server side)
diff --git a/debian/maven.rules b/debian/maven.rules
index f873a4d..7a1cc16 100644
--- a/debian/maven.rules
+++ b/debian/maven.rules
@@ -19,3 +19,4 @@
 s/org.apache.ws.commons.util/org.apache.ws.commons/ ws-commons-util jar s/.*/debian/ * *
 commons-httpclient commons-httpclient jar s/3\..*/3.x/ * *
 commons-logging s/commons-logging-api/commons-logging/ * s/.*/debian/ * *
+javax.servlet s/servlet-api/javax.servlet-api/ * s/.*/3.1/ * *
diff --git a/debian/patches/02-servlet-api-compatibility.patch b/debian/patches/02-servlet-api-compatibility.patch
new file mode 100644
index 0000000..2221a99
--- /dev/null
+++ b/debian/patches/02-servlet-api-compatibility.patch
@@ -0,0 +1,211 @@
+Description: Fixes the compatibility with the latest version of the Servlet API in Debian
+Author: Emmanuel Bourg <ebourg at apache.org>
+Forwarded: no
+--- a/server/src/main/java/org/apache/xmlrpc/webserver/HttpServletRequestImpl.java
++++ b/server/src/main/java/org/apache/xmlrpc/webserver/HttpServletRequestImpl.java
+@@ -30,6 +30,7 @@
+ import java.net.URLDecoder;
+ import java.security.Principal;
+ import java.util.ArrayList;
++import java.util.Collection;
+ import java.util.Collections;
+ import java.util.Enumeration;
+ import java.util.HashMap;
+@@ -39,11 +40,21 @@
+ import java.util.Map;
+ import java.util.StringTokenizer;
+ 
++import javax.servlet.AsyncContext;
++import javax.servlet.DispatcherType;
++import javax.servlet.ReadListener;
+ import javax.servlet.RequestDispatcher;
++import javax.servlet.ServletContext;
++import javax.servlet.ServletException;
+ import javax.servlet.ServletInputStream;
++import javax.servlet.ServletRequest;
++import javax.servlet.ServletResponse;
+ import javax.servlet.http.Cookie;
+ import javax.servlet.http.HttpServletRequest;
++import javax.servlet.http.HttpServletResponse;
+ import javax.servlet.http.HttpSession;
++import javax.servlet.http.HttpUpgradeHandler;
++import javax.servlet.http.Part;
+ 
+ import org.apache.xmlrpc.common.XmlRpcStreamConfig;
+ import org.apache.xmlrpc.util.HttpUtil;
+@@ -97,6 +108,17 @@
+ 				}
+ 				return c;
+ 			}
++
++			public boolean isFinished() {
++				return contentBytesRemaining <= 0;
++			}
++
++			public boolean isReady() {
++				return true;
++			}
++
++			public void setReadListener(ReadListener listener) {
++			}
+ 		};
+ 	}
+ 
+@@ -288,6 +310,8 @@
+ 
+ 	public HttpSession getSession(boolean pCreate) { throw new IllegalStateException("Not implemented"); }
+ 
++	public String changeSessionId() { throw new IllegalStateException("Not implemented"); }
++
+ 	public Principal getUserPrincipal() { throw new IllegalStateException("Not implemented"); }
+ 
+ 	public boolean isRequestedSessionIdFromCookie() { throw new IllegalStateException("Not implemented"); }
+@@ -331,6 +355,14 @@
+ 		}
+ 	}
+ 
++	public long getContentLengthLong() {
++		try {
++			return Long.parseLong(getHeader("content-length"));
++		} catch (NumberFormatException e) {
++			return -1;
++		}
++	}
++
+ 	public String getContentType() { return getHeader("content-type"); }
+ 
+ 	public ServletInputStream getInputStream() throws IOException {
+@@ -544,4 +576,54 @@
+ 	}
+ 
+ 	protected String getHttpVersion() { return httpVersion; }
++
++	public boolean authenticate(HttpServletResponse response) throws IOException, ServletException {
++		return false;
++	}
++
++	public void login(String username, String password) throws ServletException {
++	}
++
++	public void logout() throws ServletException {
++	}
++
++	public Collection getParts() throws IOException, ServletException {
++		throw new IllegalStateException("Not implemented");
++	}
++
++	public Part getPart(String name) throws IOException, ServletException {
++		throw new IllegalStateException("Not implemented");
++	}
++
++	public HttpUpgradeHandler upgrade(Class handlerClass) throws IOException, ServletException {
++		throw new IllegalStateException("Not implemented");
++	}
++
++	public ServletContext getServletContext() {
++		throw new IllegalStateException("Not implemented");
++	}
++
++	public AsyncContext startAsync() throws IllegalStateException {
++		throw new IllegalStateException("Not implemented");
++	}
++
++	public AsyncContext startAsync(ServletRequest servletRequest, ServletResponse servletResponse) throws IllegalStateException {
++		throw new IllegalStateException("Not implemented");
++	}
++
++	public boolean isAsyncStarted() {
++		return false;
++	}
++
++	public boolean isAsyncSupported() {
++		return false;
++	}
++
++	public AsyncContext getAsyncContext() {
++		return null;
++	}
++
++	public DispatcherType getDispatcherType() {
++		return DispatcherType.REQUEST;
++	}
+ }
+--- a/server/src/main/java/org/apache/xmlrpc/webserver/HttpServletResponseImpl.java
++++ b/server/src/main/java/org/apache/xmlrpc/webserver/HttpServletResponseImpl.java
+@@ -24,6 +24,8 @@
+ import java.io.PrintWriter;
+ import java.net.Socket;
+ import java.util.ArrayList;
++import java.util.Collection;
++import java.util.Collections;
+ import java.util.HashMap;
+ import java.util.Iterator;
+ import java.util.List;
+@@ -84,7 +86,7 @@
+ 		}
+ 	}
+ 
+-	private String getHeader(String pHeader) {
++	public String getHeader(String pHeader) {
+ 		String key = pHeader.toLowerCase();
+ 		Object o = headers.get(key);
+ 		if (o == null) {
+@@ -101,6 +103,22 @@
+ 		}
+ 	}
+ 
++	public Collection getHeaders(String pHeader) {
++		String key = pHeader.toLowerCase();
++		Object o = headers.get(key);
++		if (o == null) {
++			return Collections.emptyList();
++		} else if (o instanceof String) {
++			return Collections.singleton(o);
++		} else {
++			return (Collection) o;
++		}
++	}
++
++	public Collection getHeaderNames() {
++		return headers.keySet();
++	}
++
+ 	public void addIntHeader(String pHeader, int pValue) {
+ 		addHeader(pHeader, Integer.toString(pValue));
+ 	}
+@@ -170,6 +188,10 @@
+ 		message = pMessage;
+ 	}
+ 
++	public int getStatus() {
++		return status;
++	}
++
+ 	public void flushBuffer() throws IOException {
+ 		ostream.flush();
+ 	}
+@@ -267,6 +289,10 @@
+ 		}
+ 	}
+ 
++	public void setContentLengthLong(long len) {
++		setHeader("content-length", String.valueOf(len));
++	}
++
+ 	/** <p>Returns the content type used for the MIME body sent in this
+ 	 * response. The content type proper must have been specified
+ 	 * using setContentType(java.lang.String) before the response is
+--- a/server/src/main/java/org/apache/xmlrpc/webserver/ServletOutputStreamImpl.java
++++ b/server/src/main/java/org/apache/xmlrpc/webserver/ServletOutputStreamImpl.java
+@@ -99,4 +99,11 @@
+ 	boolean isCommitted() {
+ 		return committed;
+ 	}
++
++	public boolean isReady() {
++		return true;
++	}
++
++	public void setWriteListener(javax.servlet.WriteListener listener) {
++	}
+ }
diff --git a/debian/patches/series b/debian/patches/series
index 3209aba..0c03565 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 01-java8-compatibility.patch
+02-servlet-api-compatibility.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/libxmlrpc3-java.git



More information about the pkg-java-commits mailing list