Author: remy.maucherat(a)jboss.com
Date: 2009-04-22 13:47:49 -0400 (Wed, 22 Apr 2009)
New Revision: 1025
Added:
trunk/java/org/apache/catalina/deploy/Multipart.java
Modified:
trunk/java/javax/servlet/annotation/WebListener.java
trunk/java/javax/servlet/http/HttpServletRequest.java
trunk/java/javax/servlet/http/HttpServletRequestWrapper.java
trunk/java/javax/servlet/http/Part.java
trunk/java/org/apache/catalina/Authenticator.java
trunk/java/org/apache/catalina/authenticator/AuthenticatorBase.java
trunk/java/org/apache/catalina/connector/Request.java
trunk/java/org/apache/catalina/connector/RequestFacade.java
trunk/java/org/apache/catalina/core/DummyRequest.java
trunk/java/org/apache/catalina/startup/BaseContextScanner.java
trunk/java/org/apache/catalina/startup/ContextConfig.java
Log:
- Update API and minor cleanups.
Modified: trunk/java/javax/servlet/annotation/WebListener.java
===================================================================
--- trunk/java/javax/servlet/annotation/WebListener.java 2009-04-22 16:31:48 UTC (rev
1024)
+++ trunk/java/javax/servlet/annotation/WebListener.java 2009-04-22 17:47:49 UTC (rev
1025)
@@ -44,7 +44,7 @@
/**
* This annotation is used to declare a WebListener
*
- *@since Servlet 3.0
+ * @since Servlet 3.0
*/
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
Modified: trunk/java/javax/servlet/http/HttpServletRequest.java
===================================================================
--- trunk/java/javax/servlet/http/HttpServletRequest.java 2009-04-22 16:31:48 UTC (rev
1024)
+++ trunk/java/javax/servlet/http/HttpServletRequest.java 2009-04-22 17:47:49 UTC (rev
1025)
@@ -738,7 +738,7 @@
* HTTP status code to be returned
* to the user).
*/
- public boolean login(HttpServletResponse response)
+ public boolean authenticate(HttpServletResponse response)
throws IOException,ServletException;
Modified: trunk/java/javax/servlet/http/HttpServletRequestWrapper.java
===================================================================
--- trunk/java/javax/servlet/http/HttpServletRequestWrapper.java 2009-04-22 16:31:48 UTC
(rev 1024)
+++ trunk/java/javax/servlet/http/HttpServletRequestWrapper.java 2009-04-22 17:47:49 UTC
(rev 1025)
@@ -301,12 +301,12 @@
/**
- * The default behavior of this method is to call login on the wrapped
- * request object.
+ * The default behavior of this method is to call authenticate on the
+ * wrapped request object.
*/
- public boolean login(HttpServletResponse response)
+ public boolean authenticate(HttpServletResponse response)
throws IOException, ServletException {
- return this._getHttpServletRequest().login(response);
+ return this._getHttpServletRequest().authenticate(response);
}
Modified: trunk/java/javax/servlet/http/Part.java
===================================================================
--- trunk/java/javax/servlet/http/Part.java 2009-04-22 16:31:48 UTC (rev 1024)
+++ trunk/java/javax/servlet/http/Part.java 2009-04-22 17:47:49 UTC (rev 1025)
@@ -44,6 +44,7 @@
* <p> This class represents a part or form item that was received within a
* <code>multipart/form-data</code> POST request.
*
+ * @since Servlet 3.0
*/
public interface Part {
Modified: trunk/java/org/apache/catalina/Authenticator.java
===================================================================
--- trunk/java/org/apache/catalina/Authenticator.java 2009-04-22 16:31:48 UTC (rev 1024)
+++ trunk/java/org/apache/catalina/Authenticator.java 2009-04-22 17:47:49 UTC (rev 1025)
@@ -35,6 +35,6 @@
*/
public interface Authenticator {
- public boolean login(Request request, HttpServletResponse response)
+ public boolean authenticate(Request request, HttpServletResponse response)
throws IOException, ServletException;
}
Modified: trunk/java/org/apache/catalina/authenticator/AuthenticatorBase.java
===================================================================
--- trunk/java/org/apache/catalina/authenticator/AuthenticatorBase.java 2009-04-22
16:31:48 UTC (rev 1024)
+++ trunk/java/org/apache/catalina/authenticator/AuthenticatorBase.java 2009-04-22
17:47:49 UTC (rev 1025)
@@ -379,7 +379,7 @@
*
* @exception IOException if an input/output error occurs
*/
- public boolean login(Request request, HttpServletResponse response)
+ public boolean authenticate(Request request, HttpServletResponse response)
throws IOException, ServletException {
return authenticate(request, response, this.context.getLoginConfig());
}
Modified: trunk/java/org/apache/catalina/connector/Request.java
===================================================================
--- trunk/java/org/apache/catalina/connector/Request.java 2009-04-22 16:31:48 UTC (rev
1024)
+++ trunk/java/org/apache/catalina/connector/Request.java 2009-04-22 17:47:49 UTC (rev
1025)
@@ -2994,10 +2994,10 @@
return asyncContext;
}
- public boolean login(HttpServletResponse response) throws IOException,
+ public boolean authenticate(HttpServletResponse response) throws IOException,
ServletException {
if (context.getAuthenticator() != null) {
- return context.getAuthenticator().login(this, response);
+ return context.getAuthenticator().authenticate(this, response);
} else {
throw new
ServletException(sm.getString("coyoteRequest.noAuthenticator"));
}
Modified: trunk/java/org/apache/catalina/connector/RequestFacade.java
===================================================================
--- trunk/java/org/apache/catalina/connector/RequestFacade.java 2009-04-22 16:31:48 UTC
(rev 1024)
+++ trunk/java/org/apache/catalina/connector/RequestFacade.java 2009-04-22 17:47:49 UTC
(rev 1025)
@@ -1091,14 +1091,14 @@
}
- public boolean login(HttpServletResponse response) throws IOException,
+ public boolean authenticate(HttpServletResponse response) throws IOException,
ServletException {
if (request == null) {
throw new IllegalStateException(
sm.getString("requestFacade.nullRequest"));
}
- return request.login(response);
+ return request.authenticate(response);
}
Modified: trunk/java/org/apache/catalina/core/DummyRequest.java
===================================================================
--- trunk/java/org/apache/catalina/core/DummyRequest.java 2009-04-22 16:31:48 UTC (rev
1024)
+++ trunk/java/org/apache/catalina/core/DummyRequest.java 2009-04-22 17:47:49 UTC (rev
1025)
@@ -285,7 +285,7 @@
ServletResponse servletResponse) throws IllegalStateException { return null;
}
public DispatcherType getDispatcherType() { return null; }
public ServletResponse getServletResponse() { return null; }
- public boolean login(HttpServletResponse response) throws IOException,
+ public boolean authenticate(HttpServletResponse response) throws IOException,
ServletException { return false; }
public void login(String username, String password) throws ServletException {}
public void logout() throws ServletException {}
Added: trunk/java/org/apache/catalina/deploy/Multipart.java
===================================================================
--- trunk/java/org/apache/catalina/deploy/Multipart.java (rev 0)
+++ trunk/java/org/apache/catalina/deploy/Multipart.java 2009-04-22 17:47:49 UTC (rev
1025)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.apache.catalina.deploy;
+
+import java.io.Serializable;
+
+public class Multipart implements Serializable {
+
+ protected String location = null;
+ protected long maxFileSize = 0;
+ protected long maxRequestSize = 0;
+ protected int fileSizeThreshold = 0;
+
+ public String getLocation() {
+ return location;
+ }
+ public void setLocation(String location) {
+ this.location = location;
+ }
+ public long getMaxFileSize() {
+ return maxFileSize;
+ }
+ public void setMaxFileSize(long maxFileSize) {
+ this.maxFileSize = maxFileSize;
+ }
+ public long getMaxRequestSize() {
+ return maxRequestSize;
+ }
+ public void setMaxRequestSize(long maxRequestSize) {
+ this.maxRequestSize = maxRequestSize;
+ }
+ public int getFileSizeThreshold() {
+ return fileSizeThreshold;
+ }
+ public void setFileSizeThreshold(int fileSizeThreshold) {
+ this.fileSizeThreshold = fileSizeThreshold;
+ }
+}
Modified: trunk/java/org/apache/catalina/startup/BaseContextScanner.java
===================================================================
--- trunk/java/org/apache/catalina/startup/BaseContextScanner.java 2009-04-22 16:31:48 UTC
(rev 1024)
+++ trunk/java/org/apache/catalina/startup/BaseContextScanner.java 2009-04-22 17:47:49 UTC
(rev 1025)
@@ -251,9 +251,9 @@
String rootPath,
HashSet<String> tldPaths) {
try {
- NamingEnumeration items = resources.list(rootPath);
+ NamingEnumeration<NameClassPair> items = resources.list(rootPath);
while (items.hasMoreElements()) {
- NameClassPair item = (NameClassPair) items.nextElement();
+ NameClassPair item = items.nextElement();
String resourcePath = rootPath + "/" + item.getName();
if (!resourcePath.endsWith(".tld")
&&
(resourcePath.startsWith("/WEB-INF/classes")
Modified: trunk/java/org/apache/catalina/startup/ContextConfig.java
===================================================================
--- trunk/java/org/apache/catalina/startup/ContextConfig.java 2009-04-22 16:31:48 UTC (rev
1024)
+++ trunk/java/org/apache/catalina/startup/ContextConfig.java 2009-04-22 17:47:49 UTC (rev
1025)
@@ -53,18 +53,14 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
-import java.util.Enumeration;
import java.util.Iterator;
-import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
-import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import javax.servlet.DispatcherType;
import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
import javax.servlet.annotation.HandlesTypes;
import javax.servlet.annotation.MultipartConfig;
import javax.servlet.annotation.WebFilter;