|
|
|
@ -1,5 +1,5 @@ |
|
|
|
/* |
|
|
|
/* |
|
|
|
* Copyright 2002-2016 the original author or authors. |
|
|
|
* Copyright 2002-2018 the original author or authors. |
|
|
|
* |
|
|
|
* |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
@ -33,6 +33,7 @@ import org.springframework.web.multipart.MaxUploadSizeExceededException; |
|
|
|
import org.springframework.web.multipart.MultipartException; |
|
|
|
import org.springframework.web.multipart.MultipartException; |
|
|
|
import org.springframework.web.multipart.MultipartHttpServletRequest; |
|
|
|
import org.springframework.web.multipart.MultipartHttpServletRequest; |
|
|
|
import org.springframework.web.multipart.MultipartResolver; |
|
|
|
import org.springframework.web.multipart.MultipartResolver; |
|
|
|
|
|
|
|
import org.springframework.web.multipart.support.AbstractMultipartHttpServletRequest; |
|
|
|
import org.springframework.web.multipart.support.DefaultMultipartHttpServletRequest; |
|
|
|
import org.springframework.web.multipart.support.DefaultMultipartHttpServletRequest; |
|
|
|
import org.springframework.web.util.WebUtils; |
|
|
|
import org.springframework.web.util.WebUtils; |
|
|
|
|
|
|
|
|
|
|
|
@ -188,11 +189,14 @@ public class CommonsMultipartResolver extends CommonsFileUploadSupport |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void cleanupMultipart(MultipartHttpServletRequest request) { |
|
|
|
public void cleanupMultipart(MultipartHttpServletRequest request) { |
|
|
|
try { |
|
|
|
if (!(request instanceof AbstractMultipartHttpServletRequest) || |
|
|
|
cleanupFileItems(request.getMultiFileMap()); |
|
|
|
((AbstractMultipartHttpServletRequest) request).isResolved()) { |
|
|
|
} |
|
|
|
try { |
|
|
|
catch (Throwable ex) { |
|
|
|
cleanupFileItems(request.getMultiFileMap()); |
|
|
|
logger.warn("Failed to perform multipart cleanup for servlet request", ex); |
|
|
|
} |
|
|
|
|
|
|
|
catch (Throwable ex) { |
|
|
|
|
|
|
|
logger.warn("Failed to perform multipart cleanup for servlet request", ex); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|