From e23cd08c09ac25b671edd07895596b2ad274e5d7 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Fri, 12 Oct 2012 18:04:17 -0400
Subject: [PATCH] Added an IntelliJ module file for fun
---
src/com/gitblit/ServletRequestWrapper.java | 89 ++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 89 insertions(+), 0 deletions(-)
diff --git a/src/com/gitblit/ServletRequestWrapper.java b/src/com/gitblit/ServletRequestWrapper.java
index b97c395..d74a9ec 100644
--- a/src/com/gitblit/ServletRequestWrapper.java
+++ b/src/com/gitblit/ServletRequestWrapper.java
@@ -19,16 +19,41 @@
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.security.Principal;
+import java.util.Collection;
import java.util.Enumeration;
import java.util.Locale;
import java.util.Map;
+import javax.servlet.AsyncContext;
+import javax.servlet.DispatcherType;
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.Part;
+/**
+ * ServletRequestWrapper is a pass-through/delegate wrapper class for a servlet
+ * request. This class is used in conjunction with ServletFilters, such as the
+ * AccessRestrictionFilter.
+ *
+ * The original request is wrapped by instances of this class and this class is
+ * set as the servlet request in the filter. This allows for specialized
+ * implementations of request methods, like getUserPrincipal() with delegation
+ * to the original request for any method not overridden.
+ *
+ * This class, by itself, is not altogether interesting. Subclasses of this
+ * class, however, are of interest.
+ *
+ * @author James Moger
+ *
+ */
public abstract class ServletRequestWrapper implements HttpServletRequest {
protected final HttpServletRequest req;
@@ -308,4 +333,68 @@
public boolean isRequestedSessionIdFromUrl() {
return req.isRequestedSessionIdFromUrl();
}
+
+ /*
+ * Servlet 3.0 Methods
+ */
+
+ @Override
+ public boolean authenticate(HttpServletResponse response) throws IOException, ServletException {
+ return false;
+ }
+
+ @Override
+ public void login(String username, String password) throws ServletException {
+ }
+
+ @Override
+ public void logout() throws ServletException {
+ }
+
+
+ @Override
+ public Part getPart(String arg0) throws IOException, ServletException {
+ return req.getPart(arg0);
+ }
+
+ @Override
+ public Collection<Part> getParts() throws IOException, ServletException {
+ return req.getParts();
+ }
+
+ @Override
+ public AsyncContext getAsyncContext() {
+ return req.getAsyncContext();
+ }
+
+ @Override
+ public DispatcherType getDispatcherType() {
+ return req.getDispatcherType();
+ }
+
+ @Override
+ public ServletContext getServletContext() {
+ return req.getServletContext();
+ }
+
+ @Override
+ public boolean isAsyncStarted() {
+ return req.isAsyncStarted();
+ }
+
+ @Override
+ public boolean isAsyncSupported() {
+ return req.isAsyncStarted();
+ }
+
+ @Override
+ public AsyncContext startAsync() throws IllegalStateException {
+ return req.startAsync();
+ }
+
+ @Override
+ public AsyncContext startAsync(ServletRequest arg0, ServletResponse arg1)
+ throws IllegalStateException {
+ return req.startAsync(arg0, arg1);
+ }
}
\ No newline at end of file
--
Gitblit v1.9.1