use of org.springframework.util.LinkedMultiValueMap in project spring-framework by spring-projects.
the class AsyncRestTemplateIntegrationTests method multipart.
@Test
public void multipart() throws Exception {
MultiValueMap<String, Object> parts = new LinkedMultiValueMap<>();
parts.add("name 1", "value 1");
parts.add("name 2", "value 2+1");
parts.add("name 2", "value 2+2");
Resource logo = new ClassPathResource("/org/springframework/http/converter/logo.jpg");
parts.add("logo", logo);
HttpEntity<MultiValueMap<String, Object>> requestBody = new HttpEntity<>(parts);
Future<URI> future = template.postForLocation(baseUrl + "/multipart", requestBody);
future.get();
}
use of org.springframework.util.LinkedMultiValueMap in project spring-framework by spring-projects.
the class RestTemplateIntegrationTests method multipart.
@Test
public void multipart() throws UnsupportedEncodingException {
MultiValueMap<String, Object> parts = new LinkedMultiValueMap<>();
parts.add("name 1", "value 1");
parts.add("name 2", "value 2+1");
parts.add("name 2", "value 2+2");
Resource logo = new ClassPathResource("/org/springframework/http/converter/logo.jpg");
parts.add("logo", logo);
template.postForLocation(baseUrl + "/multipart", parts);
}
use of org.springframework.util.LinkedMultiValueMap in project spring-framework by spring-projects.
the class ReactorClientHttpResponse method getCookies.
@Override
public MultiValueMap<String, ResponseCookie> getCookies() {
MultiValueMap<String, ResponseCookie> result = new LinkedMultiValueMap<>();
this.response.cookies().values().stream().flatMap(Collection::stream).forEach(cookie -> {
ResponseCookie responseCookie = ResponseCookie.from(cookie.name(), cookie.value()).domain(cookie.domain()).path(cookie.path()).maxAge(cookie.maxAge()).secure(cookie.isSecure()).httpOnly(cookie.isHttpOnly()).build();
result.add(cookie.name(), responseCookie);
});
return CollectionUtils.unmodifiableMultiValueMap(result);
}
use of org.springframework.util.LinkedMultiValueMap in project spring-framework by spring-projects.
the class CandidateComponentsIndex method parseIndex.
private static MultiValueMap<String, String> parseIndex(List<Properties> content) {
MultiValueMap<String, String> index = new LinkedMultiValueMap<>();
for (Properties entry : content) {
for (Map.Entry<Object, Object> entries : entry.entrySet()) {
String type = (String) entries.getKey();
String[] stereotypes = ((String) entries.getValue()).split(",");
for (String stereotype : stereotypes) {
index.add(stereotype, type);
}
}
}
return index;
}
use of org.springframework.util.LinkedMultiValueMap in project spring-framework by spring-projects.
the class AnnotationMetadataReadingVisitor method getAllAnnotationAttributes.
@Override
public MultiValueMap<String, Object> getAllAnnotationAttributes(String annotationName, boolean classValuesAsString) {
MultiValueMap<String, Object> allAttributes = new LinkedMultiValueMap<>();
List<AnnotationAttributes> attributes = this.attributesMap.get(annotationName);
if (attributes == null) {
return null;
}
for (AnnotationAttributes raw : attributes) {
for (Map.Entry<String, Object> entry : AnnotationReadingVisitorUtils.convertClassValues("class '" + getClassName() + "'", this.classLoader, raw, classValuesAsString).entrySet()) {
allAttributes.add(entry.getKey(), entry.getValue());
}
}
return allAttributes;
}
Aggregations