Java Code Examples for org.springframework.http.client.MultipartBodyBuilder#build()

The following examples show how to use org.springframework.http.client.MultipartBodyBuilder#build() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
private MultiValueMap<String, HttpEntity<?>> generateBody() {
	MultipartBodyBuilder builder = new MultipartBodyBuilder();
	builder.part("fieldPart", "fieldValue");
	builder.part("fileParts", new ClassPathResource("foo.txt", MultipartHttpMessageReader.class));
	builder.part("fileParts", new ClassPathResource("logo.png", getClass()));
	builder.part("jsonPart", new Person("Jason"));
	return builder.build();
}
 
Example 2
private MultiValueMap<String, HttpEntity<?>> generateBody() {
	MultipartBodyBuilder builder = new MultipartBodyBuilder();
	builder.part("fieldPart", "fieldValue");
	builder.part("fileParts", new ClassPathResource("foo.txt", MultipartHttpMessageReader.class));
	builder.part("fileParts", new ClassPathResource("logo.png", getClass()));
	builder.part("jsonPart", new Person("Jason"));
	return builder.build();
}
 
Example 3
private MultiValueMap<String, HttpEntity<?>> generateCCBody() {
    MultipartBodyBuilder builder = new MultipartBodyBuilder();
    builder.part("verticesTopic", "initial-cc-vertices");
    builder.part("edgesTopic", "initial-cc-edges");
    builder.part("vertexFile", new ClassPathResource("vertices_simple.txt"));
    builder.part("edgeFile", new ClassPathResource("edges_simple.txt"));
    builder.part("vertexParser", VertexLongIdLongValueParser.class.getName());
    builder.part("edgeParser", EdgeLongIdLongValueParser.class.getName());
    builder.part("keySerializer", LongSerializer.class.getName());
    builder.part("vertexValueSerializer", LongSerializer.class.getName());
    builder.part("edgeValueSerializer", LongSerializer.class.getName());
    builder.part("numPartitions", "50");
    builder.part("replicationFactor", "1");
    return builder.build();
}
 
Example 4
private MultiValueMap<String, HttpEntity<?>> generateSvdppBody() {
    MultipartBodyBuilder builder = new MultipartBodyBuilder();
    builder.part("edgesTopic", "initial-svdpp-edges");
    builder.part("edgeFile", new ClassPathResource("ratings_simple.txt"));
    builder.part("edgeParser", EdgeCfLongIdFloatValueParser.class.getName());
    builder.part("edgeValueSerializer", FloatSerializer.class.getName());
    builder.part("numPartitions", "50");
    builder.part("replicationFactor", "1");
    return builder.build();
}
 
Example 5
private MultiValueMap<String, HttpEntity<?>> generateBody() {
	MultipartBodyBuilder builder = new MultipartBodyBuilder();
	builder.part("fooPart", new ClassPathResource("org/springframework/http/codec/multipart/foo.txt"));
	builder.part("barPart", "bar");
	return builder.build();
}
 
Example 6
private MultiValueMap<String, HttpEntity<?>> generateBody() {
	MultipartBodyBuilder builder = new MultipartBodyBuilder();
	builder.part("fooPart", new ClassPathResource("org/springframework/http/codec/multipart/foo.txt"));
	builder.part("barPart", "bar");
	return builder.build();
}
 
Example 7
private MultiValueMap<String, HttpEntity<?>> generateBody() {
    MultipartBodyBuilder builder = new MultipartBodyBuilder();
    builder.part("fieldPart", "fieldValue");
    builder.part("fileParts", new ByteArrayResource("data".getBytes()));
    return builder.build();
}
 
Example 8
private MultiValueMap<String, HttpEntity<?>> generateBody() {
    MultipartBodyBuilder builder = new MultipartBodyBuilder();
    builder.part("fileParts", new ClassPathResource("/foo.txt", DemoApplicationTests.class));
    return builder.build();
}
 
Example 9
private MultiValueMap<String, HttpEntity<?>> createMultipartData() {
	ClassPathResource part = new ClassPathResource("1x1.png");
	MultipartBodyBuilder builder = new MultipartBodyBuilder();
	builder.part("imgpart", part, MediaType.IMAGE_PNG);
	return builder.build();
}