Browse Source

Merge pull request #2029 in CORE/base-third from feature/10.0 to research/10.0

* commit '65d03d6933d84292e216175de88f9f4116771daf':
  DEC-17895 fix: import fileupload相关类包名错误
research/10.0
superman 4 years ago
parent
commit
335ecf993a
  1. 4
      fine-spring/src/main/java/com/fr/third/springframework/web/multipart/MultipartFile.java
  2. 24
      fine-spring/src/main/java/com/fr/third/springframework/web/multipart/commons/CommonsFileUploadSupport.java
  3. 8
      fine-spring/src/main/java/com/fr/third/springframework/web/multipart/commons/CommonsMultipartFile.java
  4. 18
      fine-spring/src/main/java/com/fr/third/springframework/web/multipart/commons/CommonsMultipartResolver.java

4
fine-spring/src/main/java/com/fr/third/springframework/web/multipart/MultipartFile.java

@ -50,7 +50,7 @@ public interface MultipartFile extends InputStreamSource {
* but it typically will not with any other than Opera.
* @return the original filename, or the empty String if no file has been chosen
* in the multipart form, or {@code null} if not defined or not available
* @see org.apache.commons.fileupload.FileItem#getName()
* @see com.fr.third.org.apache.commons.fileupload.FileItem#getName()
* @see com.fr.third.springframework.web.multipart.commons.CommonsMultipartFile#setPreserveFilename
*/
String getOriginalFilename();
@ -107,7 +107,7 @@ public interface MultipartFile extends InputStreamSource {
* @throws IOException in case of reading or writing errors
* @throws IllegalStateException if the file has already been moved
* in the filesystem and is not available anymore for another transfer
* @see org.apache.commons.fileupload.FileItem#write(File)
* @see com.fr.third.org.apache.commons.fileupload.FileItem#write(File)
* @see javax.servlet.http.Part#write(String)
*/
void transferTo(File dest) throws IOException, IllegalStateException;

24
fine-spring/src/main/java/com/fr/third/springframework/web/multipart/commons/CommonsFileUploadSupport.java

@ -23,10 +23,10 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileItemFactory;
import org.apache.commons.fileupload.FileUpload;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import com.fr.third.org.apache.commons.fileupload.FileItem;
import com.fr.third.org.apache.commons.fileupload.FileItemFactory;
import com.fr.third.org.apache.commons.fileupload.FileUpload;
import com.fr.third.org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@ -84,7 +84,7 @@ public abstract class CommonsFileUploadSupport {
/**
* Return the underlying {@code org.apache.commons.fileupload.disk.DiskFileItemFactory}
* Return the underlying {@code com.fr.third.org.apache.commons.fileupload.disk.DiskFileItemFactory}
* instance. There is hardly any need to access this.
* @return the underlying DiskFileItemFactory instance
*/
@ -93,7 +93,7 @@ public abstract class CommonsFileUploadSupport {
}
/**
* Return the underlying {@code org.apache.commons.fileupload.FileUpload}
* Return the underlying {@code com.fr.third.org.apache.commons.fileupload.FileUpload}
* instance. There is hardly any need to access this.
* @return the underlying FileUpload instance
*/
@ -105,7 +105,7 @@ public abstract class CommonsFileUploadSupport {
* Set the maximum allowed size (in bytes) before an upload gets rejected.
* -1 indicates no limit (the default).
* @param maxUploadSize the maximum upload size allowed
* @see org.apache.commons.fileupload.FileUploadBase#setSizeMax
* @see com.fr.third.org.apache.commons.fileupload.FileUploadBase#setSizeMax
*/
public void setMaxUploadSize(long maxUploadSize) {
this.fileUpload.setSizeMax(maxUploadSize);
@ -116,7 +116,7 @@ public abstract class CommonsFileUploadSupport {
* an upload gets rejected. -1 indicates no limit (the default).
* @param maxUploadSizePerFile the maximum upload size per file
* @since 4.2
* @see org.apache.commons.fileupload.FileUploadBase#setFileSizeMax
* @see com.fr.third.org.apache.commons.fileupload.FileUploadBase#setFileSizeMax
*/
public void setMaxUploadSizePerFile(long maxUploadSizePerFile) {
this.fileUpload.setFileSizeMax(maxUploadSizePerFile);
@ -127,7 +127,7 @@ public abstract class CommonsFileUploadSupport {
* Uploaded files will still be received past this amount, but they will not be
* stored in memory. Default is 10240, according to Commons FileUpload.
* @param maxInMemorySize the maximum in memory size allowed
* @see org.apache.commons.fileupload.disk.DiskFileItemFactory#setSizeThreshold
* @see com.fr.third.org.apache.commons.fileupload.disk.DiskFileItemFactory#setSizeThreshold
*/
public void setMaxInMemorySize(int maxInMemorySize) {
this.fileItemFactory.setSizeThreshold(maxInMemorySize);
@ -145,7 +145,7 @@ public abstract class CommonsFileUploadSupport {
* @see javax.servlet.ServletRequest#getCharacterEncoding
* @see javax.servlet.ServletRequest#setCharacterEncoding
* @see WebUtils#DEFAULT_CHARACTER_ENCODING
* @see org.apache.commons.fileupload.FileUploadBase#setHeaderEncoding
* @see com.fr.third.org.apache.commons.fileupload.FileUploadBase#setHeaderEncoding
*/
public void setDefaultEncoding(String defaultEncoding) {
this.fileUpload.setHeaderEncoding(defaultEncoding);
@ -248,7 +248,7 @@ public abstract class CommonsFileUploadSupport {
* @param fileItems the Commons FileIterms to parse
* @param encoding the encoding to use for form fields
* @return the Spring MultipartParsingResult
* @see CommonsMultipartFile#CommonsMultipartFile(org.apache.commons.fileupload.FileItem)
* @see CommonsMultipartFile#CommonsMultipartFile(com.fr.third.org.apache.commons.fileupload.FileItem)
*/
protected MultipartParsingResult parseFileItems(List<FileItem> fileItems, String encoding) {
MultiValueMap<String, MultipartFile> multipartFiles = new LinkedMultiValueMap<String, MultipartFile>();
@ -320,7 +320,7 @@ public abstract class CommonsFileUploadSupport {
* potentially holding temporary data on disk.
* <p>Deletes the underlying Commons FileItem instances.
* @param multipartFiles Collection of MultipartFile instances
* @see org.apache.commons.fileupload.FileItem#delete()
* @see com.fr.third.org.apache.commons.fileupload.FileItem#delete()
*/
protected void cleanupFileItems(MultiValueMap<String, MultipartFile> multipartFiles) {
for (List<MultipartFile> files : multipartFiles.values()) {

8
fine-spring/src/main/java/com/fr/third/springframework/web/multipart/commons/CommonsMultipartFile.java

@ -21,9 +21,9 @@ 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;
import com.fr.third.org.apache.commons.fileupload.FileItem;
import com.fr.third.org.apache.commons.fileupload.FileUploadException;
import com.fr.third.org.apache.commons.fileupload.disk.DiskFileItem;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@ -61,7 +61,7 @@ public class CommonsMultipartFile implements MultipartFile, Serializable {
/**
* Return the underlying {@code org.apache.commons.fileupload.FileItem}
* Return the underlying {@code com.fr.third.org.apache.commons.fileupload.FileItem}
* instance. There is hardly any need to access this.
*/
public final FileItem getFileItem() {

18
fine-spring/src/main/java/com/fr/third/springframework/web/multipart/commons/CommonsMultipartResolver.java

@ -20,12 +20,12 @@ import java.util.List;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileItemFactory;
import org.apache.commons.fileupload.FileUpload;
import org.apache.commons.fileupload.FileUploadBase;
import org.apache.commons.fileupload.FileUploadException;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import com.fr.third.org.apache.commons.fileupload.FileItem;
import com.fr.third.org.apache.commons.fileupload.FileItemFactory;
import com.fr.third.org.apache.commons.fileupload.FileUpload;
import com.fr.third.org.apache.commons.fileupload.FileUploadBase;
import com.fr.third.org.apache.commons.fileupload.FileUploadException;
import com.fr.third.org.apache.commons.fileupload.servlet.ServletFileUpload;
import com.fr.third.springframework.util.Assert;
import com.fr.third.springframework.web.context.ServletContextAware;
@ -57,8 +57,8 @@ import com.fr.third.springframework.web.util.WebUtils;
* @see #CommonsMultipartResolver(ServletContext)
* @see #setResolveLazily
* @see com.fr.third.springframework.web.portlet.multipart.CommonsPortletMultipartResolver
* @see org.apache.commons.fileupload.servlet.ServletFileUpload
* @see org.apache.commons.fileupload.disk.DiskFileItemFactory
* @see com.fr.third.org.apache.commons.fileupload.servlet.ServletFileUpload
* @see com.fr.third.org.apache.commons.fileupload.disk.DiskFileItemFactory
*/
public class CommonsMultipartResolver extends CommonsFileUploadSupport
implements MultipartResolver, ServletContextAware {
@ -102,7 +102,7 @@ public class CommonsMultipartResolver extends CommonsFileUploadSupport
}
/**
* Initialize the underlying {@code org.apache.commons.fileupload.servlet.ServletFileUpload}
* Initialize the underlying {@code com.fr.third.org.apache.commons.fileupload.servlet.ServletFileUpload}
* instance. Can be overridden to use a custom subclass, e.g. for testing purposes.
* @param fileItemFactory the Commons FileItemFactory to use
* @return the new ServletFileUpload instance

Loading…
Cancel
Save