Author: remy.maucherat(a)jboss.com
Date: 2009-08-17 12:21:14 -0400 (Mon, 17 Aug 2009)
New Revision: 1144
Modified:
trunk/java/javax/servlet/AsyncContext.java
trunk/java/javax/servlet/FilterRegistration.java
trunk/java/javax/servlet/GenericServlet.java
trunk/java/javax/servlet/Registration.java
trunk/java/javax/servlet/ServletConfig.java
trunk/java/javax/servlet/ServletContainerInitializer.java
trunk/java/javax/servlet/ServletContext.java
trunk/java/javax/servlet/ServletRegistration.java
trunk/java/javax/servlet/ServletRequest.java
trunk/java/javax/servlet/SessionCookieConfig.java
trunk/java/javax/servlet/descriptor/JspConfigDescriptor.java
trunk/java/javax/servlet/descriptor/JspPropertyGroupDescriptor.java
trunk/java/javax/servlet/http/HttpServletRequest.java
trunk/java/javax/servlet/http/HttpServletRequestWrapper.java
trunk/java/javax/servlet/http/HttpServletResponse.java
trunk/java/javax/servlet/http/HttpServletResponseWrapper.java
trunk/java/javax/servlet/http/Part.java
trunk/java/org/apache/catalina/connector/Request.java
trunk/java/org/apache/catalina/connector/RequestFacade.java
trunk/java/org/apache/catalina/connector/Response.java
trunk/java/org/apache/catalina/connector/ResponseFacade.java
trunk/java/org/apache/catalina/core/ApplicationContext.java
trunk/java/org/apache/catalina/core/ApplicationContextFacade.java
trunk/java/org/apache/catalina/core/ApplicationFilterConfig.java
trunk/java/org/apache/catalina/core/ApplicationFilterConfigFacade.java
trunk/java/org/apache/catalina/core/DummyRequest.java
trunk/java/org/apache/catalina/core/DummyResponse.java
trunk/java/org/apache/catalina/core/StandardWrapperFacade.java
trunk/java/org/apache/tomcat/util/http/fileupload/DefaultFileItem.java
Log:
- Update to current Servlet 3.0 API.
- Some fixmes for the version stuff (whatever ...) and the collection header queries are
not done either.
Modified: trunk/java/javax/servlet/AsyncContext.java
===================================================================
--- trunk/java/javax/servlet/AsyncContext.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/javax/servlet/AsyncContext.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -107,11 +107,8 @@
/**
- * Checks if this AsyncContext was initialized with the original
- * request and response objects by calling
- * {@link ServletRequest#startAsync()}, or if it was initialized
- * with wrapped request and/or response objects using
- * {@link ServletRequest#startAsync(ServletRequest, ServletResponse)}.
+ * Checks if this AsyncContext was initialized with the original or
+ * application-wrapped request and response objects.
*
* <p>This information may be used by filters invoked in the
* <i>outbound</i> direction, after a request was put into
@@ -122,9 +119,11 @@
*
* @return true if this AsyncContext was initialized with the original
* request and response objects by calling
- * {@link ServletRequest#startAsync()}, and false if it was initialized
- * with wrapped request and/or response objects using
- * {@link ServletRequest#startAsync(ServletRequest, ServletResponse)}.
+ * {@link ServletRequest#startAsync()}, or if it was initialized by
+ * calling
+ * {@link ServletRequest#startAsync(ServletRequest, ServletResponse)},
+ * and neither the ServletRequest nor ServletResponse arguments
+ * carried any application-provided wrappers; false otherwise
*/
public boolean hasOriginalRequestAndResponse();
Modified: trunk/java/javax/servlet/FilterRegistration.java
===================================================================
--- trunk/java/javax/servlet/FilterRegistration.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/javax/servlet/FilterRegistration.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -36,8 +36,7 @@
package javax.servlet;
-import java.util.EnumSet;
-import java.util.Set;
+import java.util.*;
/**
* Interface through which a {@link Filter} may be further configured.
@@ -76,13 +75,17 @@
String... servletNames);
/**
- * Gets an Iterable over the currently available servlet name mappings
- * of the Filter represented by this FilterRegistration.
+ * Gets the currently available servlet name mappings
+ * of the Filter represented by this <code>FilterRegistration</code>.
*
- * @return Iterable over the currently available servlet name
- * mappings of the Filter represented by this FilterRegistration.
+ * <p>Any changes to the returned <code>Collection</code> must not
+ * affect this <code>FilterRegistration</code>.
+ *
+ * @return a (possibly empty) <code>Collection</code> of the currently
+ * available servlet name mappings of the Filter represented by this
+ * <code>FilterRegistration</code>
*/
- public Iterable<String> getServletNameMappings();
+ public Collection<String> getServletNameMappings();
/**
* Adds a filter mapping with the given url patterns and dispatcher
@@ -114,13 +117,17 @@
String... urlPatterns);
/**
- * Gets an Iterable over the currently available URL pattern mappings
- * of the Filter represented by this FilterRegistration.
+ * Gets the currently available URL pattern mappings of the Filter
+ * represented by this <code>FilterRegistration</code>.
*
- * @return Iterable over the currently available URL pattern
- * mappings of the Filter represented by this FilterRegistration.
+ * <p>Any changes to the returned <code>Collection</code> must not
+ * affect this <code>FilterRegistration</code>.
+ *
+ * @return a (possibly empty) <code>Collection</code> of the currently
+ * available URL pattern mappings of the Filter represented by this
+ * <code>FilterRegistration</code>
*/
- public Iterable<String> getUrlPatternMappings();
+ public Collection<String> getUrlPatternMappings();
/**
* Interface through which a {@link Filter} registered via one of the
Modified: trunk/java/javax/servlet/GenericServlet.java
===================================================================
--- trunk/java/javax/servlet/GenericServlet.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/javax/servlet/GenericServlet.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -58,7 +58,6 @@
import java.io.IOException;
import java.util.Enumeration;
-import java.util.Iterator;
import java.util.ResourceBundle;
/**
Modified: trunk/java/javax/servlet/Registration.java
===================================================================
--- trunk/java/javax/servlet/Registration.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/javax/servlet/Registration.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -143,19 +143,6 @@
interface Dynamic extends Registration {
/**
- * Sets the description on the Servlet or Filter represented by
- * this dynamic Registration.
- *
- * <p>A call to this method overrides any previous setting.
- *
- * @param description the description of the servlet
- *
- * @throws IllegalStateException if the ServletContext from which
- * this dynamic Registration was obtained has already been initialized
- */
- public void setDescription(String description);
-
- /**
* Configures the Servlet or Filter represented by this dynamic
* Registration as supporting asynchronous operations or not.
*
Modified: trunk/java/javax/servlet/ServletConfig.java
===================================================================
--- trunk/java/javax/servlet/ServletConfig.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/javax/servlet/ServletConfig.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -55,7 +55,6 @@
package javax.servlet;
import java.util.Enumeration;
-import java.util.Iterator;
/**
* A servlet configuration object used by a servlet container
Modified: trunk/java/javax/servlet/ServletContainerInitializer.java
===================================================================
--- trunk/java/javax/servlet/ServletContainerInitializer.java 2009-08-17 15:53:51 UTC (rev
1143)
+++ trunk/java/javax/servlet/ServletContainerInitializer.java 2009-08-17 16:21:14 UTC (rev
1144)
@@ -81,6 +81,9 @@
*
* @param ctx The <tt>ServletContext</tt> instance in which the types
* defined via the <tt>HandlesTypes</tt> annotation were found.
+ *
+ * @throws ServletException if an error has occurred
*/
- public void onStartup(Set<Class<?>> c, ServletContext ctx);
+ public void onStartup(Set<Class<?>> c, ServletContext ctx)
+ throws ServletException;
}
Modified: trunk/java/javax/servlet/ServletContext.java
===================================================================
--- trunk/java/javax/servlet/ServletContext.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/javax/servlet/ServletContext.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -168,7 +168,7 @@
/**
- * Returns the major version of the Java Servlet API that this
+ * Returns the major version of the Servlet API that this
* servlet container supports. All implementations that comply
* with Version 3.0 must have this method return the integer 3.
*
@@ -188,6 +188,50 @@
/**
+ * Gets the major version of the Servlet specification that the
+ * application represented by this ServletContext is based on.
+ *
+ * <p>The value returned may be different from {@link #getMajorVersion},
+ * which returns the major version of the Servlet specification
+ * supported by the Servlet container.
+ *
+ * @return the major version of the Servlet specification that the
+ * application represented by this ServletContext is based on
+ *
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor
annotated
+ * with {@link javax.servlet.annotation.WebListener}
+ *
+ * @since Servlet 3.0
+ */
+ public int getEffectiveMajorVersion();
+
+
+ /**
+ * Gets the minor version of the Servlet specification that the
+ * application represented by this ServletContext is based on.
+ *
+ * <p>The value returned may be different from {@link #getMinorVersion},
+ * which returns the minor version of the Servlet specification
+ * supported by the Servlet container.
+ *
+ * @return the minor version of the Servlet specification that the
+ * application xrepresented by this ServletContext is based on
+ *
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor
annotated
+ * with {@link javax.servlet.annotation.WebListener}
+ *
+ * @since Servlet 3.0
+ */
+ public int getEffectiveMinorVersion();
+
+
+ /**
* Returns the MIME type of the specified file, or <code>null</code> if
* the MIME type is not known. The MIME type is determined
* by the configuration of the servlet container, and may be specified
@@ -576,10 +620,12 @@
* context initialization parameter with a matching name
*
* @throws IllegalStateException if this ServletContext has already
- * been initialized, or if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or
annotated
+ * been initialized
+ *
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor
annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @since Servlet 3.0
@@ -705,10 +751,12 @@
* ServletContext already contains a servlet with a matching name
*
* @throws IllegalStateException if this ServletContext has already
- * been initialized, or if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or
annotated
+ * been initialized
+ *
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor
annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @since Servlet 3.0
@@ -735,10 +783,12 @@
* container
*
* @throws IllegalStateException if this ServletContext has already
- * been initialized, or if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or
annotated
+ * been initialized
+ *
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor
annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @throws IllegalArgumentException if the given servlet instance
@@ -766,10 +816,12 @@
* ServletContext already contains a servlet with a matching name
*
* @throws IllegalStateException if this ServletContext has already
- * been initialized, or if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or
annotated
+ * been initialized
+ *
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor
annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @since Servlet 3.0
@@ -794,10 +846,10 @@
* @throws ServletException if an error occurs during the instantiation
* of, or resource injection into the new Servlet
*
- * @throws IllegalStateException if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or
annotated
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor
annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @since Servlet 3.0
@@ -813,10 +865,10 @@
* given <tt>servletName</tt>, or null if no ServletRegistration exists
* under that name in this ServletContext
*
- * @throws IllegalStateException if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or
annotated
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor
annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @since Servlet 3.0
@@ -825,7 +877,7 @@
/**
- * Gets an immutable (and possibly empty) Map of the ServletRegistration
+ * Gets a (possibly empty) Map of the ServletRegistration
* objects (keyed by servlet name) corresponding to all servlets
* registered with this ServletContext.
*
@@ -834,18 +886,21 @@
* ServletRegistration objects corresponding to all servlets that have
* been added via one of the <tt>addServlet</tt> methods.
*
+ * <p>Any changes to the returned Map must not affect this
+ * ServletContext.
+ *
* @return Map of the ServletRegistration objects corresponding
* to all servlets currently registered with this ServletContext
*
- * @throws IllegalStateException if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or
annotated
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor
annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @since Servlet 3.0
*/
- public Map<String, ServletRegistration> getServletRegistrations();
+ public Map<String, ? extends ServletRegistration> getServletRegistrations();
/**
@@ -867,10 +922,12 @@
* ServletContext already contains a filter with a matching name
*
* @throws IllegalStateException if this ServletContext has already
- * been initialized, or if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or
annotated
+ * been initialized
+ *
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor
annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @since Servlet 3.0
@@ -897,10 +954,12 @@
* container
*
* @throws IllegalStateException if this ServletContext has already
- * been initialized, or if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or
annotated
+ * been initialized
+ *
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor
annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @since Servlet 3.0
@@ -925,10 +984,12 @@
* ServletContext already contains a filter with a matching name
*
* @throws IllegalStateException if this ServletContext has already
- * been initialized, or if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or
annotated
+ * been initialized
+ *
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor
annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @since Servlet 3.0
@@ -953,10 +1014,10 @@
* @throws ServletException if an error occurs during the instantiation
* of, or resource injection into the new Filter
*
- * @throws IllegalStateException if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or
annotated
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor
annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @since Servlet 3.0
@@ -973,10 +1034,10 @@
* given <tt>filterName</tt>, or null if no FilterRegistration exists
* under that name in this ServletContext
*
- * @throws IllegalStateException if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or
annotated
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor
annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @since Servlet 3.0
@@ -985,7 +1046,7 @@
/**
- * Gets an immutable (and possibly empty) Map of the FilterRegistration
+ * Gets a (possibly empty) Map of the FilterRegistration
* objects (keyed by filter name) corresponding to all filters
* registered with this ServletContext.
*
@@ -994,18 +1055,21 @@
* FilterRegistration objects corresponding to all filters that have
* been added via one of the <tt>addFilter</tt> methods.
*
+ * <p>Any changes to the returned Map must not affect this
+ * ServletContext.
+ *
* @return Map of the FilterRegistration objects corresponding
* to all filters currently registered with this ServletContext
*
- * @throws IllegalStateException if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or
annotated
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor
annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @since Servlet 3.0
*/
- public Map<String, FilterRegistration> getFilterRegistrations();
+ public Map<String, ? extends FilterRegistration> getFilterRegistrations();
/**
@@ -1020,10 +1084,10 @@
* various properties of the session tracking cookies created on
* behalf of this <tt>ServletContext</tt> may be configured
*
- * @throws IllegalStateException if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or
annotated
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor
annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @since Servlet 3.0
@@ -1043,10 +1107,12 @@
* become effective for this <tt>ServletContext</tt>
*
* @throws IllegalStateException if this ServletContext has already
- * been initialized, or if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or
annotated
+ * been initialized
+ *
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor
annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @throws IllegalArgumentException if <tt>sessionTrackingModes</tt>
@@ -1067,10 +1133,10 @@
* @return set of the session tracking modes supported by default for
* this <tt>ServletContext</tt>
*
- * @throws IllegalStateException if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or
annotated
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor
annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @since Servlet 3.0
@@ -1092,10 +1158,10 @@
* @return set of the session tracking modes in effect for this
* <tt>ServletContext</tt>
*
- * @throws IllegalStateException if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or
annotated
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor
annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @since Servlet 3.0
@@ -1143,10 +1209,12 @@
* passed to {@link ServletContainerInitializer#onStartup}
*
* @throws IllegalStateException if this ServletContext has already
- * been initialized, or if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or
annotated
+ * been initialized
+ *
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor
annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @since Servlet 3.0
@@ -1188,10 +1256,12 @@
* passed to {@link ServletContainerInitializer#onStartup}
*
* @throws IllegalStateException if this ServletContext has already
- * been initialized, or if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or
annotated
+ * been initialized
+ *
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor
annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @since Servlet 3.0
@@ -1234,10 +1304,12 @@
* to {@link ServletContainerInitializer#onStartup}
*
* @throws IllegalStateException if this ServletContext has already
- * been initialized, or if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or
annotated
+ * been initialized
+ *
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor
annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @since Servlet 3.0
@@ -1270,10 +1342,10 @@
* @throws ServletException if an error occurs during the instantiation
* of, or resource injection into the new EventListener
*
- * @throws IllegalStateException if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or
annotated
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor
annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @throws IllegalArgumentException if the specified EventListener class
@@ -1304,6 +1376,12 @@
* represented by this ServletContext, or null if no such configuration
* exists
*
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor
annotated
+ * with {@link javax.servlet.annotation.WebListener}
+ *
* @see javax.servlet.descriptor.JspConfigDescriptor
*
* @since Servlet 3.0
@@ -1312,12 +1390,28 @@
/**
- * Gets the classloader of the web application represented by this
+ * Gets the class loader of the web application represented by this
* ServletContext.
*
- * @return the classloader of the web application represented by this
+ * <p>If a security manager exists, and the caller's class loader
+ * is not the same as, or an ancestor of the requested class loader,
+ * then the security manager's <code>checkPermission</code> method
is
+ * called with a
<code>RuntimePermission("getClassLoader")</code>
+ * permission to check whether access to the requested class loader
+ * should be granted.
+ *
+ * @return the class loader of the web application represented by this
* ServletContext
*
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor
annotated
+ * with {@link javax.servlet.annotation.WebListener}
+ *
+ * @throws SecurityException if a security manager denies access to
+ * the requested class loader
+ *
* @since Servlet 3.0
*/
public ClassLoader getClassLoader();
Modified: trunk/java/javax/servlet/ServletRegistration.java
===================================================================
--- trunk/java/javax/servlet/ServletRegistration.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/javax/servlet/ServletRegistration.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -65,13 +65,17 @@
public Set<String> addMapping(String... urlPatterns);
/**
- * Gets an Iterable over the currently available mappings of the
- * Servlet represented by this ServletRegistration.
+ * Gets the currently available mappings of the
+ * Servlet represented by this <code>ServletRegistration</code>.
*
- * @return Iterable over the currently available mappings
- * of the Servlet represented by this ServletRegistration.
+ * <p>Any changes to the returned <code>Collection</code> must not
+ * affect this <code>ServletRegistration</code>.
+ *
+ * @return a (possibly empty) <code>Collection</code> of the currently
+ * available mappings of the Servlet represented by this
+ * <code>ServletRegistration</code>
*/
- public Iterable<String> getMappings();
+ public Collection<String> getMappings();
/**
* Interface through which a {@link Servlet} registered via one of the
Modified: trunk/java/javax/servlet/ServletRequest.java
===================================================================
--- trunk/java/javax/servlet/ServletRequest.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/javax/servlet/ServletRequest.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -683,9 +683,9 @@
* {@link AsyncContext#complete}.
*
* <p>Calling {@link AsyncContext#hasOriginalRequestAndResponse()} on
- * the returned AsyncContext will return <code>false</code>
- * (unless the passed in ServletRequest and ServletResponse arguments
- * are the original ones).
+ * the returned AsyncContext will return <code>false</code>,
+ * unless the passed in ServletRequest and ServletResponse arguments
+ * are the original ones or do not carry any application-provided wrappers.
* Any filters invoked in the <i>outbound</i> direction after this
* request was put into asynchronous mode may use this as an indication
* that some of the request and/or response wrappers that they added
Modified: trunk/java/javax/servlet/SessionCookieConfig.java
===================================================================
--- trunk/java/javax/servlet/SessionCookieConfig.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/javax/servlet/SessionCookieConfig.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -272,6 +272,10 @@
* cookies created on behalf of the <tt>ServletContext</tt> from which
* this <tt>SessionCookieConfig</tt> was acquired.
*
+ * @throws IllegalStateException if the <tt>ServletContext</tt>
+ * from which this <tt>SessionCookieConfig</tt> was acquired has
+ * already been initialized
+ *
* @see javax.servlet.http.Cookie#setMaxAge
*/
public void setMaxAge(int maxAge);
Modified: trunk/java/javax/servlet/descriptor/JspConfigDescriptor.java
===================================================================
--- trunk/java/javax/servlet/descriptor/JspConfigDescriptor.java 2009-08-17 15:53:51 UTC
(rev 1143)
+++ trunk/java/javax/servlet/descriptor/JspConfigDescriptor.java 2009-08-17 16:21:14 UTC
(rev 1144)
@@ -36,6 +36,8 @@
package javax.servlet.descriptor;
+import java.util.Collection;
+
/**
* This interface provides access to the
<code><jsp-config></code>
* related configuration of a web application.
@@ -48,22 +50,32 @@
public interface JspConfigDescriptor {
/**
- * Gets an <code>Iterable</code> over the
<code><taglib></code>
- * elements that are nested inside the
<code><jsp-config></code>.
+ * Gets the <code><taglib></code> child elements of the
+ * <code><jsp-config></code> element represented by this
+ * <code>JspConfigDescriptor</code>.
*
- * @return <code>Iterable</code> over the
<code>taglib</code>
- * elements that are nested inside the <code>jsp-config</code>
+ * <p>Any changes to the returned <code>Collection</code> must not
+ * affect this <code>JspConfigDescriptor</code>.
+ *
+ * @return a (possibly empty) <code>Collection</code> of the
+ * <code><taglib<>/code> child elements of the
+ * <code><jsp-config></code> element represented by this
+ * <code>JspConfigDescriptor</code>
*/
- public Iterable<TaglibDescriptor> getTaglibs();
+ public Collection<TaglibDescriptor> getTaglibs();
/**
- * Gets an <code>Iterable</code> over the
- * <code><jsp-property-group></code> elements that are
nested
- * inside the <code><jsp-config></code>.
+ * Gets the <code><jsp-property-group></code> child
elements
+ * of the <code><jsp-config></code> element represented by
this
+ * <code>JspConfigDescriptor</code>.
*
- * @return <code>Iterable</code> over the
- * <code><jsp-property-group></code>
- * elements that are nested inside the
<code><jsp-config></code>
+ * <p>Any changes to the returned <code>Collection</code> must not
+ * affect this <code>JspConfigDescriptor</code>.
+ *
+ * @return a (possibly empty) <code>Collection</code> of the
+ * <code><jsp-property-group></code> child elements of the
+ * <code><jsp-config></code> element represented by this
+ * <code>JspConfigDescriptor</code>
*/
- public Iterable<JspPropertyGroupDescriptor> getJspPropertyGroups();
+ public Collection<JspPropertyGroupDescriptor> getJspPropertyGroups();
}
Modified: trunk/java/javax/servlet/descriptor/JspPropertyGroupDescriptor.java
===================================================================
--- trunk/java/javax/servlet/descriptor/JspPropertyGroupDescriptor.java 2009-08-17
15:53:51 UTC (rev 1143)
+++ trunk/java/javax/servlet/descriptor/JspPropertyGroupDescriptor.java 2009-08-17
16:21:14 UTC (rev 1144)
@@ -36,6 +36,8 @@
package javax.servlet.descriptor;
+import java.util.Collection;
+
/**
* This interface provides access to the
* <code><jsp-property-group></code>
@@ -50,18 +52,22 @@
/**
* Gets the URL patterns of the JSP property group represented by this
- * JspPropertyGroupDescriptor.
+ * <code>JspPropertyGroupDescriptor</code>.
*
- * @return Iterable over the URL patterns of the JSP property group
- * represented by this JspPropertyGroupDescriptor
+ * <p>Any changes to the returned <code>Collection</code> must not
+ * affect this <code>JspPropertyGroupDescriptor</code>.
+ *
+ * @return a (possibly empty) <code>Collection</code> of the URL
+ * patterns of the JSP property group represented by this
+ * <code>JspPropertyGroupDescriptor</code>
*/
- public Iterable<String> getUrlPatterns();
+ public Collection<String> getUrlPatterns();
/**
* Gets the value of the <code>el-ignored</code> configuration, which
* specifies whether Expression Language (EL) evaluation is enabled for
* any JSP pages mapped to the JSP property group represented by this
- * JspPropertyGroupDescriptor.
+ * <code>JspPropertyGroupDescriptor</code>.
*
* @return the value of the <code>el-ignored</code> configuration, or
* null if unspecified
@@ -72,7 +78,7 @@
* Gets the value of the <code>page-encoding</code> configuration,
* which specifies the default page encoding for any JSP pages mapped
* to the JSP property group represented by this
- * JspPropertyGroupDescriptor.
+ * <code>JspPropertyGroupDescriptor</code>.
*
* @return the value of the <code>page-encoding</code> configuration, or
* null if unspecified
@@ -83,7 +89,7 @@
* Gets the value of the <code>scripting-invalid</code> configuration,
* which specifies whether scripting is enabled for any JSP pages mapped
* to the JSP property group represented by this
- * JspPropertyGroupDescriptor.
+ * <code>JspPropertyGroupDescriptor</code>.
*
* @return the value of the <code>scripting-invalid</code>
configuration,
* or null if unspecified
@@ -93,8 +99,8 @@
/**
* Gets the value of the <code>is-xml</code> configuration, which
* specifies whether any JSP pages mapped to the JSP property group
- * represented by this JspPropertyGroupDescriptor should be treated
- * as JSP documents (XML syntax).
+ * represented by this <code>JspPropertyGroupDescriptor</code> will
+ * be treated as JSP documents (XML syntax).
*
* @return the value of the <code>is-xml</code> configuration, or
* null if unspecified
@@ -102,24 +108,34 @@
public String getIsXml();
/**
- * Gets an Iterable over the <code>include-prelude</code> configuration
+ * Gets the <code>include-prelude</code> configuration
* of the JSP property group represented by this
- * JspPropertyGroupDescriptor.
+ * <code>JspPropertyGroupDescriptor</code>.
*
- * @return Iterable over the <code>include-prelude</code> configuration
of
- * the JSP property group represented by this JspPropertyGroupDescriptor
+ * <p>Any changes to the returned <code>Collection</code> must not
+ * affect this <code>JspPropertyGroupDescriptor</code>.
+ *
+ * @return a (possibly empty) <code>Collection</code> of the
+ * <code>include-prelude</code> configuration of
+ * the JSP property group represented by this
+ * <code>JspPropertyGroupDescriptor</code>
*/
- public Iterable<String> getIncludePreludes();
+ public Collection<String> getIncludePreludes();
/**
- * Gets an Iterable over the <code>include-coda</code> configuration
+ * Gets the <code>include-coda</code> configuration
* of the JSP property group represented by this
- * JspPropertyGroupDescriptor.
+ * <code>JspPropertyGroupDescriptor</code>.
*
- * @return Iterable over the <code>include-coda</code> configuration of
- * the JSP property group represented by this JspPropertyGroupDescriptor
+ * <p>Any changes to the returned <code>Collection</code> must not
+ * affect this <code>JspPropertyGroupDescriptor</code>.
+ *
+ * @return a (possibly empty) <code>Collection</code> of the
+ * <code>include-coda</code> configuration of
+ * the JSP property group represented by this
+ * <code>JspPropertyGroupDescriptor</code>
*/
- public Iterable<String> getIncludeCodas();
+ public Collection<String> getIncludeCodas();
/**
* Gets the value of the
@@ -128,7 +144,7 @@
* which is normally reserved for Expression Language (EL) expressions,
* will cause a translation error if it appears as a String literal
* in any JSP pages mapped to the JSP property group represented by
- * this JspPropertyGroupDescriptor.
+ * this <code>JspPropertyGroupDescriptor</code>.
*
* @return the value of the
* <code>deferred-syntax-allowed-as-literal</code> configuration, or
@@ -141,7 +157,7 @@
* configuration, which specifies whether template text containing only
* whitespaces must be removed from the response output of any JSP
* pages mapped to the JSP property group represented by this
- * JspPropertyGroupDescriptor.
+ * <code>JspPropertyGroupDescriptor</code>.
*
* @return the value of the <code>trim-directive-whitespaces</code>
* configuration, or null if unspecified
@@ -152,7 +168,7 @@
* Gets the value of the <code>default-content-type</code>
configuration,
* which specifies the default response content type for any JSP pages
* mapped to the JSP property group represented by this
- * JspPropertyGroupDescriptor.
+ * <code>JspPropertyGroupDescriptor</code>.
*
* @return the value of the <code>default-content-type</code>
* configuration, or null if unspecified
@@ -163,7 +179,7 @@
* Gets the value of the <code>buffer</code> configuration, which
* specifies the default size of the response buffer for any JSP pages
* mapped to the JSP property group represented by this
- * JspPropertyGroupDescriptor.
+ * <code>JspPropertyGroupDescriptor</code>.
*
* @return the value of the <code>buffer</code> configuration, or
* null if unspecified
@@ -175,7 +191,7 @@
* configuration, which specifies whether an error will be raised at
* translation time if tag with an undeclared namespace is used in
* any JSP pages mapped to the JSP property group represented by this
- * JspPropertyGroupDescriptor.
+ * <code>JspPropertyGroupDescriptor</code>.
*
* @return the value of the <code>error-on-undeclared-namespace</code>
* configuration, or null if unspecified
Modified: trunk/java/javax/servlet/http/HttpServletRequest.java
===================================================================
--- trunk/java/javax/servlet/http/HttpServletRequest.java 2009-08-17 15:53:51 UTC (rev
1143)
+++ trunk/java/javax/servlet/http/HttpServletRequest.java 2009-08-17 16:21:14 UTC (rev
1144)
@@ -55,9 +55,9 @@
package javax.servlet.http;
import java.io.IOException;
+import java.util.*;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
-import java.util.Enumeration;
/**
*
@@ -803,15 +803,20 @@
*
* <p>If this request is of type <tt>multipart/form-data</tt>, but
* does not contain any Part components, the returned
- * <tt>Iterable</tt> will be empty.
+ * <tt>Collection</tt> will be empty.
*
- * @return A (possibly empty) <code>Iterable</code> over all the
+ * <p>Any changes to the returned <code>Collection</code> must not
+ * affect this <code>HttpServletRequest</code>.
+ *
+ * @return a (possibly empty) <code>Collection</code> of the
* Part components of this request
*
* @throws IOException if an I/O error occurred during the retrieval
* of the {@link Part} components of this request
+ *
* @throws ServletException if this request is not of type
* <tt>multipart/form-data</tt>
+ *
* @throws IllegalStateException if the request body is larger than
* <tt>maxRequestSize</tt>, or any Part in the request is larger than
* <tt>maxFileSize</tt>
@@ -821,7 +826,7 @@
*
* @since Servlet 3.0
*/
- public Iterable<Part> getParts() throws IOException, ServletException;
+ public Collection<Part> getParts() throws IOException, ServletException;
/**
Modified: trunk/java/javax/servlet/http/HttpServletRequestWrapper.java
===================================================================
--- trunk/java/javax/servlet/http/HttpServletRequestWrapper.java 2009-08-17 15:53:51 UTC
(rev 1143)
+++ trunk/java/javax/servlet/http/HttpServletRequestWrapper.java 2009-08-17 16:21:14 UTC
(rev 1144)
@@ -55,9 +55,9 @@
package javax.servlet.http;
import java.io.IOException;
+import java.util.*;
import javax.servlet.ServletException;
import javax.servlet.ServletRequestWrapper;
-import java.util.Enumeration;
/**
* Provides a convenient implementation of the HttpServletRequest interface
@@ -338,9 +338,12 @@
* The default behavior of this method is to call getParts on the wrapped
* request object.
*
+ * <p>Any changes to the returned <code>Collection</code> must not
+ * affect this <code>HttpServletRequestWrapper</code>.
+ *
* @since Servlet 3.0
*/
- public Iterable<Part> getParts() throws IOException, ServletException {
+ public Collection<Part> getParts() throws IOException, ServletException {
return this._getHttpServletRequest().getParts();
}
Modified: trunk/java/javax/servlet/http/HttpServletResponse.java
===================================================================
--- trunk/java/javax/servlet/http/HttpServletResponse.java 2009-08-17 15:53:51 UTC (rev
1143)
+++ trunk/java/javax/servlet/http/HttpServletResponse.java 2009-08-17 16:21:14 UTC (rev
1144)
@@ -57,7 +57,7 @@
package javax.servlet.http;
import java.io.IOException;
-
+import java.util.Collection;
import javax.servlet.ServletResponse;
/**
@@ -393,40 +393,43 @@
/**
- * Gets the values of the response header with the given name
- * as an <tt>Iterable</tt> of <tt>String</tt> objects.
+ * Gets the values of the response header with the given name.
*
* <p>This method considers only response headers set or added via
* {@link #setHeader}, {@link #addHeader}, {@link #setDateHeader},
* {@link #addDateHeader}, {@link #setIntHeader}, or
* {@link #addIntHeader}, respectively.
*
+ * <p>Any changes to the returned <code>Collection</code> must not
+ * affect this <code>HttpServletResponse</code>.
+ *
* @param name the name of the response header whose values to return
*
- * @return the values of the response header with the given name,
- * or an empty <tt>Iterable</tt> if no header with the given name
- * has been set on this response
+ * @return a (possibly empty) <code>Collection</code> of the values
+ * of the response header with the given name
*
* @since Servlet 3.0
*/
- public Iterable<String> getHeaders(String name);
+ public Collection<String> getHeaders(String name);
/**
- * Gets the names of the headers of this response
- * as an <tt>Iterable</tt> of <tt>String</tt> objects.
+ * Gets the names of the headers of this response.
*
* <p>This method considers only response headers set or added via
* {@link #setHeader}, {@link #addHeader}, {@link #setDateHeader},
* {@link #addDateHeader}, {@link #setIntHeader}, or
* {@link #addIntHeader}, respectively.
*
- * @return the names of the headers of this response, or an empty
- * <tt>Iterable</tt> if no headers have been set on this response
+ * <p>Any changes to the returned <code>Collection</code> must not
+ * affect this <code>HttpServletResponse</code>.
*
+ * @return a (possibly empty) <code>Collection</code> of the names
+ * of the headers of this response
+ *
* @since Servlet 3.0
*/
- public Iterable<String> getHeaderNames();
+ public Collection<String> getHeaderNames();
/*
Modified: trunk/java/javax/servlet/http/HttpServletResponseWrapper.java
===================================================================
--- trunk/java/javax/servlet/http/HttpServletResponseWrapper.java 2009-08-17 15:53:51 UTC
(rev 1143)
+++ trunk/java/javax/servlet/http/HttpServletResponseWrapper.java 2009-08-17 16:21:14 UTC
(rev 1144)
@@ -57,7 +57,7 @@
package javax.servlet.http;
import java.io.IOException;
-
+import java.util.Collection;
import javax.servlet.ServletResponseWrapper;
/**
@@ -262,6 +262,8 @@
* @return the value of the response header with the given name,
* or <tt>null</tt> if no header with the given name has been set
* on the wrapped response
+ *
+ * @since Servlet 3.0
*/
public String getHeader(String name) {
return _getHttpServletResponse().getHeader(name);
@@ -273,13 +275,17 @@
* {@link HttpServletResponse#getHeaders} on the wrapped response
* object.
*
+ * <p>Any changes to the returned <code>Collection</code> must not
+ * affect this <code>HttpServletResponseWrapper</code>.
+ *
* @param name the name of the response header whose values to return
*
- * @return the values of the response header with the given name,
- * or an empty <tt>Iterable</tt> if no header with the given name
- * has been set on the wrapped response
+ * @return a (possibly empty) <code>Collection</code> of the values
+ * of the response header with the given name
+ *
+ * @since Servlet 3.0
*/
- public Iterable<String> getHeaders(String name) {
+ public Collection<String> getHeaders(String name) {
return _getHttpServletResponse().getHeaders(name);
}
@@ -289,11 +295,15 @@
* {@link HttpServletResponse#getHeaderNames} on the wrapped response
* object.
*
- * @return the names of the headers of the wrapped response, or an empty
- * <tt>Iterable</tt> if no headers have been set on the wrapped
- * response
+ * <p>Any changes to the returned <code>Collection</code> must not
+ * affect this <code>HttpServletResponseWrapper</code>.
+ *
+ * @return a (possibly empty) <code>Collection</code> of the names
+ * of the response headers
+ *
+ * @since Servlet 3.0
*/
- public Iterable<String> getHeaderNames() {
+ public Collection<String> getHeaderNames() {
return _getHttpServletResponse().getHeaderNames();
}
Modified: trunk/java/javax/servlet/http/Part.java
===================================================================
--- trunk/java/javax/servlet/http/Part.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/javax/servlet/http/Part.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -36,10 +36,9 @@
package javax.servlet.http;
-import java.io.InputStream;
-import java.io.IOException;
+import java.io.*;
+import java.util.*;
-
/**
* <p> This class represents a part or form item that was received within a
* <code>multipart/form-data</code> POST request.
@@ -64,7 +63,6 @@
*/
public String getContentType();
-
/**
* Gets the name of this part
*
@@ -72,8 +70,6 @@
*/
public String getName();
-
-
/**
* Returns the size of this fille.
*
@@ -81,23 +77,22 @@
*/
public long getSize();
-
/**
* A convenience method to write this uploaded item to disk.
- * <p>
- * This method is not guaranteed to succeed if called more than once for
+ *
+ * <p>This method is not guaranteed to succeed if called more than once for
* the same part. This allows a particular implementation to use, for
* example, file renaming, where possible, rather than copying all of the
* underlying data, thus gaining a significant performance benefit.
*
- * @param fileName a<code>String</code> specifying the file name which
the stream is written out to.
- * The file is created relative to the location as specified in the MultipartConfig
+ * @param fileName the name of the file to which the stream will be
+ * written. The file is created relative to the location as
+ * specified in the MultipartConfig
*
* @throws IOException if an error occurs.
*/
public void write(String fileName) throws IOException;
-
/**
* Deletes the underlying storage for a file item, including deleting any
* associated temporary disk file.
@@ -124,58 +119,37 @@
* header, or <code>null</code>
* if the part does not
* have a header of that name
- *
*/
-
public String getHeader(String name);
/**
+ * Gets the values of the Part header with the given name.
*
- * Returns all the values of the specified Part header
- * as an <code>Iterable</code> of <code>String</code>
objects.
+ * <p>Any changes to the returned <code>Collection</code> must not
+ * affect this <code>Part</code>.
*
- * <p>If the Part did not include any headers
- * of the specified name, this method returns an empty
- * <code>Iterable</code>.
- * The header name is case insensitive. You can use
- * this method with any Part header.
+ * <p>Part header names are case insensitive.
*
- * @param name a <code>String</code> specifying the
- * header name
+ * @param name the header name whose values to return
*
- * @return an <code>Iterable</code> containing
- * the values of the requested header. If
- * the Part does not have any headers of
- * that name return an empty
- * Iterable. If
- * the container does not allow access to
- * header information, return null
- *
+ * @return a (possibly empty) <code>Collection</code> of the values of
+ * the header with the given name
*/
+ public Collection<String> getHeaders(String name);
- public Iterable<String> getHeaders(String name);
-
/**
+ * Gets the header names of this Part.
*
- * Returns an Iterable of all the header names
- * this part contains. If the part has no
- * headers, this method returns an empty Iterable.
- *
* <p>Some servlet containers do not allow
* servlets to access headers using this method, in
* which case this method returns <code>null</code>
*
- * @return an Iterable of all the
- * header names sent with this
- * part; if the part has
- * no headers, an empty Iterable;
- * if the servlet container does not
- * allow servlets to use this method,
- * <code>null</code>
+ * <p>Any changes to the returned <code>Collection</code> must not
+ * affect this <code>Part</code>.
*
- *
+ * @return a (possibly empty) <code>Collection</code> of the header
+ * names of this Part
*/
+ public Collection<String> getHeaderNames();
- public Iterable<String> getHeaderNames();
-
}
Modified: trunk/java/org/apache/catalina/connector/Request.java
===================================================================
--- trunk/java/org/apache/catalina/connector/Request.java 2009-08-17 15:53:51 UTC (rev
1143)
+++ trunk/java/org/apache/catalina/connector/Request.java 2009-08-17 16:21:14 UTC (rev
1144)
@@ -54,6 +54,7 @@
import java.security.Principal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Iterator;
@@ -3112,7 +3113,7 @@
}
- public Iterable<Part> getParts() throws ServletException {
+ public Collection<Part> getParts() throws ServletException {
if (parts == null) {
parseMultipart();
}
Modified: trunk/java/org/apache/catalina/connector/RequestFacade.java
===================================================================
--- trunk/java/org/apache/catalina/connector/RequestFacade.java 2009-08-17 15:53:51 UTC
(rev 1143)
+++ trunk/java/org/apache/catalina/connector/RequestFacade.java 2009-08-17 16:21:14 UTC
(rev 1144)
@@ -22,6 +22,7 @@
import java.io.IOException;
import java.security.AccessController;
import java.security.PrivilegedAction;
+import java.util.Collection;
import java.util.Enumeration;
import java.util.Locale;
import java.util.Map;
@@ -1132,7 +1133,7 @@
}
- public Iterable<Part> getParts() throws ServletException {
+ public Collection<Part> getParts() throws ServletException {
if (request == null) {
throw new IllegalStateException(
sm.getString("requestFacade.nullRequest"));
Modified: trunk/java/org/apache/catalina/connector/Response.java
===================================================================
--- trunk/java/org/apache/catalina/connector/Response.java 2009-08-17 15:53:51 UTC (rev
1143)
+++ trunk/java/org/apache/catalina/connector/Response.java 2009-08-17 16:21:14 UTC (rev
1144)
@@ -29,6 +29,7 @@
import java.security.PrivilegedExceptionAction;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Enumeration;
import java.util.Locale;
import java.util.TimeZone;
@@ -874,7 +875,7 @@
* Return an array of all the header names set for this response, or
* a zero-length array if no headers have been set.
*/
- public Iterable<String> getHeaderNames() {
+ public Collection<String> getHeaderNames() {
MimeHeaders headers = coyoteResponse.getMimeHeaders();
int n = headers.size();
@@ -912,7 +913,7 @@
*
* @param name Header name to look up
*/
- public Iterable<String> getHeaders(String name) {
+ public Collection<String> getHeaders(String name) {
// FIXME
return null;
}
Modified: trunk/java/org/apache/catalina/connector/ResponseFacade.java
===================================================================
--- trunk/java/org/apache/catalina/connector/ResponseFacade.java 2009-08-17 15:53:51 UTC
(rev 1143)
+++ trunk/java/org/apache/catalina/connector/ResponseFacade.java 2009-08-17 16:21:14 UTC
(rev 1144)
@@ -24,6 +24,7 @@
import java.security.PrivilegedAction;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
+import java.util.Collection;
import java.util.Locale;
import javax.servlet.ServletOutputStream;
@@ -563,7 +564,7 @@
}
- public Iterable<String> getHeaderNames() {
+ public Collection<String> getHeaderNames() {
if (response == null) {
throw new IllegalStateException(
sm.getString("responseFacade.nullResponse"));
@@ -573,7 +574,7 @@
}
- public Iterable<String> getHeaders(String name) {
+ public Collection<String> getHeaders(String name) {
if (response == null) {
throw new IllegalStateException(
sm.getString("responseFacade.nullResponse"));
Modified: trunk/java/org/apache/catalina/core/ApplicationContext.java
===================================================================
--- trunk/java/org/apache/catalina/core/ApplicationContext.java 2009-08-17 15:53:51 UTC
(rev 1143)
+++ trunk/java/org/apache/catalina/core/ApplicationContext.java 2009-08-17 16:21:14 UTC
(rev 1144)
@@ -52,6 +52,7 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
import java.util.Enumeration;
import java.util.EventListener;
@@ -1133,6 +1134,17 @@
}
+ public int getEffectiveMajorVersion() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+
+ public int getEffectiveMinorVersion() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
// -------------------------------------------------------- Package Methods
protected StandardContext getContext() {
return this.context;
@@ -1277,19 +1289,19 @@
*/
private static final class JspConfigDescriptorImpl implements JspConfigDescriptor {
- private Iterable<JspPropertyGroupDescriptor> jspPropertyGroups;
- private Iterable<TaglibDescriptor> taglibs;
- public JspConfigDescriptorImpl(Iterable<JspPropertyGroupDescriptor>
jspPropertyGroups,
- Iterable<TaglibDescriptor> taglibs) {
+ private Collection<JspPropertyGroupDescriptor> jspPropertyGroups;
+ private Collection<TaglibDescriptor> taglibs;
+ public JspConfigDescriptorImpl(Collection<JspPropertyGroupDescriptor>
jspPropertyGroups,
+ Collection<TaglibDescriptor> taglibs) {
this.jspPropertyGroups = jspPropertyGroups;
this.taglibs = taglibs;
}
- public Iterable<JspPropertyGroupDescriptor> getJspPropertyGroups() {
+ public Collection<JspPropertyGroupDescriptor> getJspPropertyGroups() {
return jspPropertyGroups;
}
- public Iterable<TaglibDescriptor> getTaglibs() {
+ public Collection<TaglibDescriptor> getTaglibs() {
return taglibs;
}
Modified: trunk/java/org/apache/catalina/core/ApplicationContextFacade.java
===================================================================
--- trunk/java/org/apache/catalina/core/ApplicationContextFacade.java 2009-08-17 15:53:51
UTC (rev 1143)
+++ trunk/java/org/apache/catalina/core/ApplicationContextFacade.java 2009-08-17 16:21:14
UTC (rev 1144)
@@ -635,6 +635,24 @@
}
+ public int getEffectiveMajorVersion() {
+ if (SecurityUtil.isPackageProtectionEnabled()) {
+ return (Integer) doPrivileged("getEffectiveMajorVersion", null);
+ } else {
+ return context.getEffectiveMajorVersion();
+ }
+ }
+
+
+ public int getEffectiveMinorVersion() {
+ if (SecurityUtil.isPackageProtectionEnabled()) {
+ return (Integer) doPrivileged("getEffectiveMinorVersion", null);
+ } else {
+ return context.getEffectiveMinorVersion();
+ }
+ }
+
+
/**
* Use reflection to invoke the requested method. Cache the method object
* to speed up the process
Modified: trunk/java/org/apache/catalina/core/ApplicationFilterConfig.java
===================================================================
--- trunk/java/org/apache/catalina/core/ApplicationFilterConfig.java 2009-08-17 15:53:51
UTC (rev 1143)
+++ trunk/java/org/apache/catalina/core/ApplicationFilterConfig.java 2009-08-17 16:21:14
UTC (rev 1144)
@@ -50,6 +50,7 @@
import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
import java.util.EnumSet;
import java.util.Enumeration;
@@ -307,7 +308,7 @@
}
- public Iterable<String> getServletNameMappings() {
+ public Collection<String> getServletNameMappings() {
HashSet<String> result = new HashSet<String>();
FilterMap[] filterMaps = context.findFilterMaps();
for (int i = 0; i < filterMaps.length; i++) {
@@ -326,7 +327,7 @@
}
- public Iterable<String> getUrlPatternMappings() {
+ public Collection<String> getUrlPatternMappings() {
HashSet<String> result = new HashSet<String>();
FilterMap[] filterMaps = context.findFilterMaps();
for (int i = 0; i < filterMaps.length; i++) {
Modified: trunk/java/org/apache/catalina/core/ApplicationFilterConfigFacade.java
===================================================================
--- trunk/java/org/apache/catalina/core/ApplicationFilterConfigFacade.java 2009-08-17
15:53:51 UTC (rev 1143)
+++ trunk/java/org/apache/catalina/core/ApplicationFilterConfigFacade.java 2009-08-17
16:21:14 UTC (rev 1144)
@@ -47,6 +47,7 @@
package org.apache.catalina.core;
+import java.util.Collection;
import java.util.Collections;
import java.util.EnumSet;
import java.util.Enumeration;
@@ -169,12 +170,12 @@
}
- public Iterable<String> getServletNameMappings() {
+ public Collection<String> getServletNameMappings() {
return config.getServletNameMappings();
}
- public Iterable<String> getUrlPatternMappings() {
+ public Collection<String> getUrlPatternMappings() {
return config.getUrlPatternMappings();
}
Modified: trunk/java/org/apache/catalina/core/DummyRequest.java
===================================================================
--- trunk/java/org/apache/catalina/core/DummyRequest.java 2009-08-17 15:53:51 UTC (rev
1143)
+++ trunk/java/org/apache/catalina/core/DummyRequest.java 2009-08-17 16:21:14 UTC (rev
1144)
@@ -25,6 +25,7 @@
import java.io.UnsupportedEncodingException;
import java.net.Socket;
import java.security.Principal;
+import java.util.Collection;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.Locale;
@@ -291,7 +292,7 @@
public void logout() throws ServletException {}
public long getAsyncTimeout() { return 0; }
public Part getPart(String name) throws IllegalArgumentException { return null; }
- public Iterable<Part> getParts() { return null; }
+ public Collection<Part> getParts() { return null; }
}
Modified: trunk/java/org/apache/catalina/core/DummyResponse.java
===================================================================
--- trunk/java/org/apache/catalina/core/DummyResponse.java 2009-08-17 15:53:51 UTC (rev
1143)
+++ trunk/java/org/apache/catalina/core/DummyResponse.java 2009-08-17 16:21:14 UTC (rev
1144)
@@ -22,6 +22,7 @@
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;
+import java.util.Collection;
import java.util.Locale;
import javax.servlet.ServletOutputStream;
@@ -97,7 +98,7 @@
public Cookie[] getCookies() { return null; }
public String getHeader(String name) { return null; }
- public Iterable<String> getHeaderNames() { return null; }
+ public Collection<String> getHeaderNames() { return null; }
public String[] getHeaderValues(String name) { return null; }
public String getMessage() { return null; }
public int getStatus() { return -1; }
@@ -123,7 +124,7 @@
public void disable() {}
public void enable() {}
public boolean isDisabled() { return false; }
- public Iterable<String> getHeaders(String name) { return null; }
+ public Collection<String> getHeaders(String name) { return null; }
}
Modified: trunk/java/org/apache/catalina/core/StandardWrapperFacade.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardWrapperFacade.java 2009-08-17 15:53:51 UTC
(rev 1143)
+++ trunk/java/org/apache/catalina/core/StandardWrapperFacade.java 2009-08-17 16:21:14 UTC
(rev 1144)
@@ -47,6 +47,7 @@
package org.apache.catalina.core;
+import java.util.Collection;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
@@ -203,7 +204,7 @@
}
- public Iterable<String> getMappings() {
+ public Collection<String> getMappings() {
HashSet<String> result = new HashSet<String>();
String[] mappings = wrapper.findMappings();
for (int i = 0; i < mappings.length; i++) {
Modified: trunk/java/org/apache/tomcat/util/http/fileupload/DefaultFileItem.java
===================================================================
--- trunk/java/org/apache/tomcat/util/http/fileupload/DefaultFileItem.java 2009-08-17
15:53:51 UTC (rev 1143)
+++ trunk/java/org/apache/tomcat/util/http/fileupload/DefaultFileItem.java 2009-08-17
16:21:14 UTC (rev 1144)
@@ -29,6 +29,7 @@
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
+import java.util.Collection;
import java.util.Map;
@@ -537,12 +538,12 @@
}
- public Iterable<String> getHeaderNames() {
+ public Collection<String> getHeaderNames() {
return headers.keySet();
}
- public Iterable<String> getHeaders(String name) {
+ public Collection<String> getHeaders(String name) {
// FIXME: Create a Set out of the comma separated values
return null;
}