Various upgrades for version 6.1

* Upgrade to Gradle `8.0.1`
* Upgrade to Kotlin `1.8`
* Some other libs updates
* Resolve some compatible TODOs
This commit is contained in:
abilan
2023-02-21 16:50:01 -05:00
parent 7d0265845a
commit 2884bf0135
11 changed files with 139 additions and 155 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2023 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.
@@ -56,7 +56,7 @@ public class MultipartAwareFormHttpMessageConverter implements HttpMessageConver
/**
* Sets the character set used for writing form data.
* Set the character set used for writing form data.
* @param charset The charset.
*/
public void setCharset(Charset charset) {
@@ -112,8 +112,8 @@ public class MultipartAwareFormHttpMessageConverter implements HttpMessageConver
private MultiValueMap<String, ?> readMultipart(MultipartHttpInputMessage multipartRequest) throws IOException {
MultiValueMap<String, Object> resultMap = new LinkedMultiValueMap<>();
Map<?, ?> parameterMap = multipartRequest.getParameterMap();
parameterMap.forEach((key, value) -> resultMap.add((String) key, value));
MultiValueMap<String, String> parameterMap = multipartRequest.getParameterMap();
parameterMap.forEach(resultMap::addAll);
for (Map.Entry<String, List<MultipartFile>> entry : multipartRequest.getMultiFileMap().entrySet()) {
List<MultipartFile> multipartFiles = entry.getValue();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* Copyright 2002-2023 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.
@@ -16,11 +16,13 @@
package org.springframework.integration.http.multipart;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.springframework.http.server.ServletServerHttpRequest;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
@@ -63,10 +65,13 @@ public class MultipartHttpInputMessage extends ServletServerHttpRequest implemen
return this.multipartServletRequest.getFiles(name);
}
// TODO: return MultiValueMap?
@SuppressWarnings("rawtypes")
public Map getParameterMap() {
return this.multipartServletRequest.getParameterMap();
public MultiValueMap<String, String> getParameterMap() {
return this.multipartServletRequest.getParameterMap()
.entrySet()
.stream()
.collect(LinkedMultiValueMap::new,
(params, entry) -> params.addAll(entry.getKey(), Arrays.asList(entry.getValue())),
LinkedMultiValueMap::addAll);
}
public String getMultipartContentType(String paramOrFileName) {