diff --git a/spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionAspectSupport.java b/spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionAspectSupport.java index eff63690b0..4b8389f8b6 100644 --- a/spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionAspectSupport.java +++ b/spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionAspectSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,7 +31,7 @@ import org.springframework.util.StringUtils; /** * Base class for asynchronous method execution aspects, such as - * {@link org.springframework.scheduling.annotation.AnnotationAsyncExecutionInterceptor} + * {@code org.springframework.scheduling.annotation.AnnotationAsyncExecutionInterceptor} * or {@code org.springframework.scheduling.aspectj.AnnotationAsyncExecutionAspect}. * *
Provides support for executor qualification on a method-by-method basis.
diff --git a/spring-context/src/test/java/org/springframework/scheduling/config/ExecutorBeanDefinitionParserTests.java b/spring-context/src/test/java/org/springframework/scheduling/config/ExecutorBeanDefinitionParserTests.java
index 74e3d76639..9777e559e1 100644
--- a/spring-context/src/test/java/org/springframework/scheduling/config/ExecutorBeanDefinitionParserTests.java
+++ b/spring-context/src/test/java/org/springframework/scheduling/config/ExecutorBeanDefinitionParserTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,7 +20,6 @@ import java.util.concurrent.Callable;
import java.util.concurrent.Executor;
import java.util.concurrent.FutureTask;
-import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
@@ -32,6 +31,8 @@ import org.springframework.core.task.TaskExecutor;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.util.CustomizableThreadCreator;
+import static org.junit.Assert.*;
+
/**
* @author Mark Fisher
* @author Juergen Hoeller
@@ -47,21 +48,23 @@ public class ExecutorBeanDefinitionParserTests {
"executorContext.xml", ExecutorBeanDefinitionParserTests.class);
}
+
@Test
public void defaultExecutor() throws Exception {
- Object executor = this.context.getBean("default");
+ ThreadPoolTaskExecutor executor = this.context.getBean("default", ThreadPoolTaskExecutor.class);
assertEquals(1, getCorePoolSize(executor));
assertEquals(Integer.MAX_VALUE, getMaxPoolSize(executor));
assertEquals(Integer.MAX_VALUE, getQueueCapacity(executor));
assertEquals(60, getKeepAliveSeconds(executor));
assertEquals(false, getAllowCoreThreadTimeOut(executor));
+
FutureTask The servlet and all filters involved in an async request must have async
* support enabled using the Servlet API or by adding an
* {@code In Servlet 3 async processing, the timeout period begins after the
+ * In Servlet 3 async processing, the timeout period begins after the
* container processing thread has exited.
*/
public void setTimeout(Long timeout) {
@@ -82,7 +81,7 @@ public class StandardServletAsyncWebRequest extends ServletWebRequest implements
}
public boolean isAsyncStarted() {
- return ((this.asyncContext != null) && getRequest().isAsyncStarted());
+ return (this.asyncContext != null && getRequest().isAsyncStarted());
}
/**
@@ -101,6 +100,7 @@ public class StandardServletAsyncWebRequest extends ServletWebRequest implements
"or by adding \" If the file has been moved in the filesystem, this operation cannot
* be invoked again. Therefore, call this method just once to be able to
* work with any storage mechanism.
+ * Note: when using Servlet 3.0 multipart support you
+ * need to configure the location relative to which files will be copied
+ * as explained in {@link javax.servlet.http.Part#write}.
* @param dest the destination file
* @throws IOException in case of reading or writing errors
* @throws IllegalStateException if the file has already been moved
diff --git a/spring-web/src/main/java/org/springframework/web/multipart/MultipartResolver.java b/spring-web/src/main/java/org/springframework/web/multipart/MultipartResolver.java
index 3fd05f9151..79898d9646 100644
--- a/spring-web/src/main/java/org/springframework/web/multipart/MultipartResolver.java
+++ b/spring-web/src/main/java/org/springframework/web/multipart/MultipartResolver.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,8 +26,10 @@ import javax.servlet.http.HttpServletRequest;
*
* There are two concrete implementations included in Spring, as of Spring 3.1:
* There is no default resolver implementation used for Spring
@@ -38,14 +40,11 @@ import javax.servlet.http.HttpServletRequest;
* application context. Such a resolver gets applied to all requests handled
* by that {@link org.springframework.web.servlet.DispatcherServlet}.
*
- * If a {@link org.springframework.web.servlet.DispatcherServlet} detects
- * a multipart request, it will resolve it via the configured
- * {@link MultipartResolver} and pass on a
- * wrapped {@link javax.servlet.http.HttpServletRequest}.
- * Controllers can then cast their given request to the
- * {@link MultipartHttpServletRequest}
- * interface, which permits access to any
- * {@link MultipartFile MultipartFiles}.
+ * If a {@link org.springframework.web.servlet.DispatcherServlet} detects a
+ * multipart request, it will resolve it via the configured {@link MultipartResolver}
+ * and pass on a wrapped {@link javax.servlet.http.HttpServletRequest}. Controllers
+ * can then cast their given request to the {@link MultipartHttpServletRequest}
+ * interface, which allows for access to any {@link MultipartFile MultipartFiles}.
* Note that this cast is only supported in case of an actual multipart request.
*
* As an alternative to using a
- * {@link MultipartResolver} with a
+ * As an alternative to using a {@link MultipartResolver} with a
* {@link org.springframework.web.servlet.DispatcherServlet},
* a {@link org.springframework.web.multipart.support.MultipartFilter} can be
* registered in {@code web.xml}. It will delegate to a corresponding
- * {@link MultipartResolver} bean in the root
- * application context. This is mainly intended for applications that do not
- * use Spring's own web MVC framework.
+ * {@link MultipartResolver} bean in the root application context. This is mainly
+ * intended for applications that do not use Spring's own web MVC framework.
*
- * Note: There is hardly ever a need to access the
- * {@link MultipartResolver} itself
- * from application code. It will simply do its work behind the scenes,
- * making
- * {@link MultipartHttpServletRequest MultipartHttpServletRequests}
+ * Note: There is hardly ever a need to access the {@link MultipartResolver}
+ * itself from application code. It will simply do its work behind the scenes,
+ * making {@link MultipartHttpServletRequest MultipartHttpServletRequests}
* available to controllers.
*
* @author Juergen Hoeller
@@ -101,8 +96,8 @@ public interface MultipartResolver {
/**
* Parse the given HTTP request into multipart files and parameters,
* and wrap the request inside a
- * {@link org.springframework.web.multipart.MultipartHttpServletRequest} object
- * that provides access to file descriptors and makes contained
+ * {@link org.springframework.web.multipart.MultipartHttpServletRequest}
+ * object that provides access to file descriptors and makes contained
* parameters accessible via the standard ServletRequest methods.
* @param request the servlet request to wrap (must be of a multipart content type)
* @return the wrapped servlet request
diff --git a/spring-web/src/main/java/org/springframework/web/multipart/commons/CommonsFileUploadSupport.java b/spring-web/src/main/java/org/springframework/web/multipart/commons/CommonsFileUploadSupport.java
index e05e110a7d..f6e6f6c6bc 100644
--- a/spring-web/src/main/java/org/springframework/web/multipart/commons/CommonsFileUploadSupport.java
+++ b/spring-web/src/main/java/org/springframework/web/multipart/commons/CommonsFileUploadSupport.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -39,7 +39,7 @@ import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.util.WebUtils;
/**
- * Base class for multipart resolvers that use Jakarta Commons FileUpload
+ * Base class for multipart resolvers that use Apache Commons FileUpload
* 1.2 or above.
*
* Provides common configuration properties and parsing functionality
diff --git a/spring-web/src/main/java/org/springframework/web/multipart/commons/CommonsMultipartFile.java b/spring-web/src/main/java/org/springframework/web/multipart/commons/CommonsMultipartFile.java
index ae9ae6ecf1..ac9854deb3 100644
--- a/spring-web/src/main/java/org/springframework/web/multipart/commons/CommonsMultipartFile.java
+++ b/spring-web/src/main/java/org/springframework/web/multipart/commons/CommonsMultipartFile.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@ import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
+
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileUploadException;
import org.apache.commons.fileupload.disk.DiskFileItem;
@@ -30,7 +31,7 @@ import org.apache.commons.logging.LogFactory;
import org.springframework.web.multipart.MultipartFile;
/**
- * MultipartFile implementation for Jakarta Commons FileUpload.
+ * MultipartFile implementation for Apache Commons FileUpload.
*
* @author Trevor D. Cook
* @author Juergen Hoeller
@@ -56,6 +57,7 @@ public class CommonsMultipartFile implements MultipartFile, Serializable {
this.size = this.fileItem.getSize();
}
+
/**
* Return the underlying {@code org.apache.commons.fileupload.FileItem}
* instance. There is hardly any need to access this.
@@ -75,18 +77,18 @@ public class CommonsMultipartFile implements MultipartFile, Serializable {
// Should never happen.
return "";
}
- // check for Unix-style path
+ // Check for Unix-style path
int pos = filename.lastIndexOf("/");
if (pos == -1) {
- // check for Windows-style path
+ // Check for Windows-style path
pos = filename.lastIndexOf("\\");
}
if (pos != -1) {
- // any sort of path separator found
+ // Any sort of path separator found...
return filename.substring(pos + 1);
}
else {
- // plain name
+ // A plain name
return filename;
}
}
diff --git a/spring-web/src/main/java/org/springframework/web/multipart/commons/CommonsMultipartResolver.java b/spring-web/src/main/java/org/springframework/web/multipart/commons/CommonsMultipartResolver.java
index 25f743befc..80f266ed26 100644
--- a/spring-web/src/main/java/org/springframework/web/multipart/commons/CommonsMultipartResolver.java
+++ b/spring-web/src/main/java/org/springframework/web/multipart/commons/CommonsMultipartResolver.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -37,8 +37,8 @@ import org.springframework.web.multipart.support.DefaultMultipartHttpServletRequ
import org.springframework.web.util.WebUtils;
/**
- * Servlet-based {@link org.springframework.web.multipart.MultipartResolver} implementation
- * for Jakarta Commons FileUpload
+ * Servlet-based {@link MultipartResolver} implementation for
+ * Apache Commons FileUpload
* 1.2 or above.
*
* Provides "maxUploadSize", "maxInMemorySize" and "defaultEncoding" settings as
diff --git a/spring-web/src/main/java/org/springframework/web/multipart/commons/package-info.java b/spring-web/src/main/java/org/springframework/web/multipart/commons/package-info.java
index 931eaf305a..001283a1fe 100644
--- a/spring-web/src/main/java/org/springframework/web/multipart/commons/package-info.java
+++ b/spring-web/src/main/java/org/springframework/web/multipart/commons/package-info.java
@@ -1,9 +1,5 @@
-
/**
- *
* MultipartResolver implementation for
- * Jakarta Commons FileUpload.
- *
+ * Apache Commons FileUpload.
*/
package org.springframework.web.multipart.commons;
-
diff --git a/spring-web/src/main/java/org/springframework/web/util/WebUtils.java b/spring-web/src/main/java/org/springframework/web/util/WebUtils.java
index 044cfb2922..b33c6ce6f1 100644
--- a/spring-web/src/main/java/org/springframework/web/util/WebUtils.java
+++ b/spring-web/src/main/java/org/springframework/web/util/WebUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2014 the original author or authors.
+ * Copyright 2002-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -174,7 +174,7 @@ public abstract class WebUtils {
* i.e. the value of the "defaultHtmlEscape" context-param in {@code web.xml}
* (if any). Falls back to {@code false} in case of no explicit default given.
* @param servletContext the servlet context of the web application
- * @return whether default HTML escaping is enabled (default is false)
+ * @return whether default HTML escaping is enabled (default is {@code false})
*/
public static boolean isDefaultHtmlEscape(ServletContext servletContext) {
if (servletContext == null) {
@@ -192,14 +192,15 @@ public abstract class WebUtils {
* an actual boolean value specified, allowing to have a context-specific
* default in case of no setting at the global level.
* @param servletContext the servlet context of the web application
- * @return whether default HTML escaping is enabled (null = no explicit default)
+ * @return whether default HTML escaping is enabled for the given application
+ * ({@code null} = no explicit default)
*/
public static Boolean getDefaultHtmlEscape(ServletContext servletContext) {
if (servletContext == null) {
return null;
}
String param = servletContext.getInitParameter(HTML_ESCAPE_CONTEXT_PARAM);
- return (StringUtils.hasText(param)? Boolean.valueOf(param) : null);
+ return (StringUtils.hasText(param) ? Boolean.valueOf(param) : null);
}
/**
@@ -730,9 +731,9 @@ public abstract class WebUtils {
* like this {@code "q1=a;q1=b;q2=a,b,c"}. The resulting map would contain
* keys {@code "q1"} and {@code "q2"} with values {@code ["a","b"]} and
* {@code ["a","b","c"]} respectively.
- *
* @param matrixVariables the unparsed matrix variables string
- * @return a map with matrix variable names and values, never {@code null}
+ * @return a map with matrix variable names and values (never {@code null})
+ * @since 3.2
*/
public static MultiValueMap
- *
*
*
@@ -58,23 +57,19 @@ import javax.servlet.http.HttpServletRequest;
* Instead of direct access, command or form controllers can register a
* {@link org.springframework.web.multipart.support.ByteArrayMultipartFileEditor}
* or {@link org.springframework.web.multipart.support.StringMultipartFileEditor}
- * with their data binder, to automatically apply multipart content to command
+ * with their data binder, to automatically apply multipart content to form
* bean properties.
*
- *