Skip to content

Commit a91491b

Browse files
authored
Merge pull request #7764 from OpenLiberty/7610-MicroProfile-7.0-ID
7610-MicroProfile 7.0 ID-012
2 parents cad8ed8 + 08a0312 commit a91491b

File tree

2 files changed

+1
-58
lines changed

2 files changed

+1
-58
lines changed

modules/ROOT/pages/send-receive-multipart-jaxrs.adoc

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -45,63 +45,6 @@ buildscript {
4545
}
4646
----
4747

48-
[#multipart]
49-
== Processing multipart data
50-
51-
The `multipart/form-data` media type enables requests to send multiple entities (parts) as a single entity using `jakarta.ws.rs.core.EntityPart` objects.
52-
53-
For example, MicroProfile Multipart Rest Clients are defined as Java interfaces.
54-
55-
[source,java]
56-
----
57-
@Consumes(MediaType.MULTIPART_FORM_DATA)
58-
@Produces(MediaType.MULTIPART_FORM_DATA)
59-
@Path("/test-app")
60-
public interface MultiPartClient extends AutoCloseable {
61-
62-
@POST
63-
@Path("upload/")
64-
void uploadFile(List<EntityPart> entityParts) throws IOException;
65-
}
66-
----
67-
68-
The example code utilizing this ingerface
69-
70-
source,java]
71-
----
72-
public void uploadMultipleFiles() throws Exception {
73-
try (MultiPartClient client = RestClientBuilder.newBuilder()
74-
.baseUri(uri)
75-
.build(MultiPartClient.class)) {
76-
final Map<String, byte[]> entityPartContent = new LinkedHashMap<>(2);
77-
try (InputStream in = MultiPartClientTest.class
78-
.getResourceAsStream("/multipart/test-file1.txt")) {
79-
entityPartContent.put("test-file1.txt", in.readAllBytes());
80-
}
81-
try (InputStream in = MultiPartClientTest.class
82-
.getResourceAsStream("/multipart/test-file2.txt")) {
83-
entityPartContent.put("test-file2.txt", in.readAllBytes());
84-
}
85-
final List<EntityPart> files = entityPartContent.entrySet()
86-
.stream()
87-
.map((entry) -> {
88-
try {
89-
return EntityPart.withName(entry.getKey())
90-
.fileName(entry.getKey())
91-
.content(entry.getValue())
92-
.mediaType(MediaType.APPLICATION_OCTET_STREAM_TYPE)
93-
.build();
94-
} catch (IOException e) {
95-
throw new UncheckedIOException(e);
96-
}
97-
})
98-
.collect(Collectors.toList());
99-
client.uploadFile(files);
100-
101-
}
102-
}
103-
----
104-
10548

10649
== Send multipart/form-data parts from Jakarta Restful Web Services resources
10750

modules/reference/pages/diff/mp-61-70-diff.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ RestClientBuilder.newBuilder()
9090

9191
=== Processing multipart data
9292

93-
Information and example code are added to the xref:ROOT:send-receive-multipart-jaxrs.adoc#multipart[send and receive multipart/form-data parts in Jakarta Restful Web Services] for processing multipart data, introduced as part of RESTful Web Services version 3.1 in EE10.
93+
The link:https://download.eclipse.org/microprofile/microprofile-rest-client-4.0/microprofile-rest-client-spec-4.0.html#_processing_multipart_data[MicroProfile Rest Client 4.0 specification] includes information and example code for processing multipart data, introduced as part of RESTful Web Services version 3.1 in EE10.
9494

9595

9696
[#openapi]

0 commit comments

Comments
 (0)