Package: jackrabbit / 2.18.0+r2.14.6-1

servlet-api.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
From: Markus Koschany <apo@debian.org>
Date: Sun, 5 Nov 2017 14:49:24 +0100
Subject: servlet api

Compatibility patch for Debian's newer servlet API.

Forwarded: no
---
 .../jackrabbit/webdav/WebdavRequestImpl.java       | 100 +++++++++++++++++++--
 .../jackrabbit/webdav/WebdavResponseImpl.java      |  33 +++++++
 2 files changed, 127 insertions(+), 6 deletions(-)

--- a/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/WebdavRequestImpl.java
+++ b/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/WebdavRequestImpl.java
@@ -36,6 +36,17 @@ import javax.servlet.ServletInputStream;
 import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpSession;
+import javax.servlet.AsyncContext;
+import javax.servlet.DispatcherType;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpUpgradeHandler;
+import javax.servlet.http.Part;
+
+
 import javax.xml.parsers.ParserConfigurationException;
 
 import org.apache.jackrabbit.webdav.bind.BindInfo;
@@ -76,6 +87,8 @@ import org.slf4j.LoggerFactory;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.xml.sax.SAXException;
+import java.lang.IllegalStateException;
+import java.util.Collection;
 
 /**
  * <code>WebdavRequestImpl</code>...
@@ -831,11 +844,11 @@ public class WebdavRequestImpl implement
         return httpRequest.getHeader(s);
     }
 
-    public Enumeration<?> getHeaders(String s) {
+    public Enumeration<String> getHeaders(String s) {
         return httpRequest.getHeaders(s);
     }
 
-    public Enumeration<?> getHeaderNames() {
+    public Enumeration<String> getHeaderNames() {
         return httpRequest.getHeaderNames();
     }
 
@@ -919,7 +932,7 @@ public class WebdavRequestImpl implement
         return httpRequest.getAttribute(s);
     }
 
-    public Enumeration<?> getAttributeNames() {
+    public Enumeration<String> getAttributeNames() {
         return httpRequest.getAttributeNames();
     }
 
@@ -947,7 +960,7 @@ public class WebdavRequestImpl implement
         return httpRequest.getParameter(s);
     }
 
-    public Enumeration<?> getParameterNames() {
+    public Enumeration<String> getParameterNames() {
         return httpRequest.getParameterNames();
     }
 
@@ -955,7 +968,7 @@ public class WebdavRequestImpl implement
         return httpRequest.getParameterValues(s);
     }
 
-    public Map<?,?> getParameterMap() {
+    public Map<String,String[]> getParameterMap() {
         return httpRequest.getParameterMap();
     }
 
@@ -999,7 +1012,7 @@ public class WebdavRequestImpl implement
         return httpRequest.getLocale();
     }
 
-    public Enumeration<?> getLocales() {
+    public Enumeration<Locale> getLocales() {
         return httpRequest.getLocales();
     }
 
@@ -1014,4 +1027,79 @@ public class WebdavRequestImpl implement
     public String getRealPath(String s) {
         return httpRequest.getRealPath(s);
     }
+    // Compat Servlet 2.4
+    public int getRemotePort() {
+       return httpRequest.getRemotePort();
+    }
+    public int getLocalPort() {
+       return httpRequest.getLocalPort();
+    }
+
+    public String getLocalName() {
+       return httpRequest.getLocalName();
+    }
+
+    public String getLocalAddr() {
+       return httpRequest.getLocalAddr();
+    }
+    //---< servlet 3.1 >---
+    public Part getPart(String name) throws IOException, IllegalStateException, ServletException {
+        throw new UnsupportedOperationException("Not supported.");
+    }
+
+    public Collection<Part> getParts() throws IOException, IllegalStateException, ServletException {
+        throw new UnsupportedOperationException("Not supported.");
+    }
+
+    public void logout() throws ServletException {
+        throw new UnsupportedOperationException("Not supported.");
+    }
+
+    public void login(String username, String password) throws ServletException {
+        throw new UnsupportedOperationException("Not supported.");
+    }
+
+    public boolean authenticate(HttpServletResponse response) throws IOException, ServletException {
+        throw new UnsupportedOperationException("Not supported.");
+    }
+
+    public DispatcherType getDispatcherType() {
+        throw new UnsupportedOperationException("Not supported.");
+    }
+
+    public AsyncContext getAsyncContext() {
+        throw new UnsupportedOperationException("Not supported.");
+    }
+
+    public boolean isAsyncSupported() {
+        throw new UnsupportedOperationException("Not supported.");
+    }
+
+    public boolean isAsyncStarted() {
+        throw new UnsupportedOperationException("Not supported.");
+    }
+
+    public AsyncContext startAsync(ServletRequest servletRequest, ServletResponse servletResponse) {
+        throw new UnsupportedOperationException("Not supported.");
+    }
+
+    public AsyncContext startAsync() {
+        throw new UnsupportedOperationException("Not supported.");
+    }
+
+    public ServletContext getServletContext() {
+        throw new UnsupportedOperationException("Not supported.");
+    }
+
+    public <T extends HttpUpgradeHandler> T upgrade(java.lang.Class<T> httpUpgradeHandlerClass) throws java.io.IOException, ServletException {
+        throw new UnsupportedOperationException("Not supported.");
+    }
+
+    public String changeSessionId() {
+        throw new UnsupportedOperationException("Not supported.");
+    }
+
+    public long getContentLengthLong() {
+        throw new UnsupportedOperationException("Not supported.");
+    }
 }
--- a/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/WebdavResponseImpl.java
+++ b/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/WebdavResponseImpl.java
@@ -44,6 +44,8 @@ import java.io.PrintWriter;
 import java.io.Writer;
 import java.nio.charset.StandardCharsets;
 import java.util.Locale;
+import javax.servlet.ServletException;
+import java.util.Collection;
 
 /**
  * WebdavResponseImpl implements the <code>WebdavResponse</code> interface.
@@ -311,4 +313,35 @@ public class WebdavResponseImpl implemen
     public Locale getLocale() {
         return httpResponse.getLocale();
     }
+    // Compat Servlet 2.4
+    public void setCharacterEncoding(String env) {
+       httpResponse.setCharacterEncoding(env);
+    }
+    public String getContentType() {
+       return httpResponse.getContentType();
+    }
+    //---< servlet 3.0 >---
+    public Collection<String> getHeaderNames() {
+        throw new UnsupportedOperationException("Not supported.");
+    }
+
+    public String getHeader(String name) {
+        throw new UnsupportedOperationException("Not supported.");
+    }
+
+    public Collection<String> getHeaders(String name) {
+        throw new UnsupportedOperationException("Not supported.");
+    }
+
+    public void logout() throws ServletException {
+        throw new UnsupportedOperationException("Not supported.");
+    }
+
+    public int getStatus() {
+        throw new UnsupportedOperationException("Not supported.");
+    }
+
+    public void setContentLengthLong(long length) {
+        throw new UnsupportedOperationException("Not supported.");
+    }
 }