"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "spring-web/src/main/java/org/springframework/http/client/MultipartBodyBuilder.java" between
spring-framework-5.3.7.tar.gz and spring-framework-5.3.8.tar.gz

About: Spring Framework is an application framework for the Java platform and .NET Framework. Community edition.

MultipartBodyBuilder.java  (spring-framework-5.3.7):MultipartBodyBuilder.java  (spring-framework-5.3.8)
/* /*
* Copyright 2002-2019 the original author or authors. * Copyright 2002-2021 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.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* https://www.apache.org/licenses/LICENSE-2.0 * https://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
skipping to change at line 132 skipping to change at line 132
* @return builder that allows for further customization of part headers * @return builder that allows for further customization of part headers
*/ */
public PartBuilder part(String name, Object part, @Nullable MediaType con tentType) { public PartBuilder part(String name, Object part, @Nullable MediaType con tentType) {
Assert.hasLength(name, "'name' must not be empty"); Assert.hasLength(name, "'name' must not be empty");
Assert.notNull(part, "'part' must not be null"); Assert.notNull(part, "'part' must not be null");
if (part instanceof Part) { if (part instanceof Part) {
Part partObject = (Part) part; Part partObject = (Part) part;
PartBuilder builder = asyncPart(name, partObject.content( ), DataBuffer.class); PartBuilder builder = asyncPart(name, partObject.content( ), DataBuffer.class);
if (!partObject.headers().isEmpty()) { if (!partObject.headers().isEmpty()) {
builder.headers(headers -> headers.putAll(partObj builder.headers(headers -> {
ect.headers())); headers.putAll(partObject.headers());
String filename = headers.getContentDispo
sition().getFilename();
// reset to parameter name
headers.setContentDispositionFormData(nam
e, filename);
});
} }
if (contentType != null) { if (contentType != null) {
builder.contentType(contentType); builder.contentType(contentType);
} }
return builder; return builder;
} }
if (part instanceof PublisherEntity<?,?>) { if (part instanceof PublisherEntity<?,?>) {
PublisherPartBuilder<?, ?> builder = new PublisherPartBui lder<>(name, (PublisherEntity<?, ?>) part); PublisherPartBuilder<?, ?> builder = new PublisherPartBui lder<>(name, (PublisherEntity<?, ?>) part);
if (contentType != null) { if (contentType != null) {
 End of changes. 2 change blocks. 
3 lines changed or deleted 9 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)