@Override
public MultipartFile resolve(Invocation inv, ParamMetaData metaData) {
MultipartFile multipartFile = null;
if (inv.getRequest() instanceof MultipartRequest) {
MultipartRequest multipartRequest = (MultipartRequest) inv.getRequest();
String fileName = metaData.getParamName();
if (StringUtils.isBlank(fileName)) {
@SuppressWarnings("unchecked")
Iterator<String> allFileNames = multipartRequest.getFileNames();
if (allFileNames.hasNext()) {
fileName = allFileNames.next();
}
}
if (StringUtils.isNotBlank(fileName)) {
multipartFile = multipartRequest.getFile(fileName);
}
if (multipartFile == null) {
if (StringUtils.isNotBlank(fileName)) {
if (logger.isDebugEnabled()) {
logger.debug("not found multipartFile named " + fileName