From a017a7f1c7f03bc18308442410de130a98c9ce30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Vav=C5=99=C3=ADk?= Date: Thu, 22 Dec 2022 23:16:34 +0100 Subject: [PATCH] Drop deprecated @MultipartForm annotation, it is surplus to requirements deprecated by https://github.com/quarkusio/quarkus/issues/22205 (cherry picked from commit a3d897abdc9ccb0be07d1161c4136d7d6f209b75) --- .../ts/http/jaxrs/reactive/MultipartResource.java | 9 ++++----- .../ts/http/jaxrs/reactive/client/MultipartService.java | 3 +-- .../ts/http/restclient/reactive/files/FileClient.java | 3 +-- .../ts/http/restclient/reactive/files/FileResource.java | 3 +-- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/http/jaxrs-reactive/src/main/java/io/quarkus/ts/http/jaxrs/reactive/MultipartResource.java b/http/jaxrs-reactive/src/main/java/io/quarkus/ts/http/jaxrs/reactive/MultipartResource.java index 9ed397e1e..55bfb4b37 100644 --- a/http/jaxrs-reactive/src/main/java/io/quarkus/ts/http/jaxrs/reactive/MultipartResource.java +++ b/http/jaxrs-reactive/src/main/java/io/quarkus/ts/http/jaxrs/reactive/MultipartResource.java @@ -9,7 +9,6 @@ import javax.ws.rs.core.MediaType; import org.apache.commons.io.IOUtils; -import org.jboss.resteasy.reactive.MultipartForm; @Path("/multipart") public class MultipartResource { @@ -17,7 +16,7 @@ public class MultipartResource { @POST @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces(MediaType.MULTIPART_FORM_DATA) - public MultipartBody postForm(@MultipartForm MultipartBody multipartBody) { + public MultipartBody postForm(MultipartBody multipartBody) { return multipartBody; } @@ -25,7 +24,7 @@ public MultipartBody postForm(@MultipartForm MultipartBody multipartBody) { @Path("/text") @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces(MediaType.TEXT_PLAIN) - public String postFormReturnText(@MultipartForm MultipartBody multipartBody) { + public String postFormReturnText(MultipartBody multipartBody) { return multipartBody.text; } @@ -33,7 +32,7 @@ public String postFormReturnText(@MultipartForm MultipartBody multipartBody) { @Path("/image") @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces(MediaType.APPLICATION_OCTET_STREAM) - public byte[] postFormReturnFile(@MultipartForm MultipartBody multipartBody) throws IOException { + public byte[] postFormReturnFile(MultipartBody multipartBody) throws IOException { return IOUtils.toByteArray(multipartBody.image.toURI()); } @@ -41,7 +40,7 @@ public byte[] postFormReturnFile(@MultipartForm MultipartBody multipartBody) thr @Path("/data") @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces(MediaType.APPLICATION_OCTET_STREAM) - public byte[] postFormReturnData(@MultipartForm MultipartBody multipartBody) throws IOException { + public byte[] postFormReturnData(MultipartBody multipartBody) throws IOException { return IOUtils.toByteArray(multipartBody.data.toURI()); } diff --git a/http/jaxrs-reactive/src/main/java/io/quarkus/ts/http/jaxrs/reactive/client/MultipartService.java b/http/jaxrs-reactive/src/main/java/io/quarkus/ts/http/jaxrs/reactive/client/MultipartService.java index 92a438cc5..6c05f4de4 100644 --- a/http/jaxrs-reactive/src/main/java/io/quarkus/ts/http/jaxrs/reactive/client/MultipartService.java +++ b/http/jaxrs-reactive/src/main/java/io/quarkus/ts/http/jaxrs/reactive/client/MultipartService.java @@ -7,7 +7,6 @@ import javax.ws.rs.core.MediaType; import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; -import org.jboss.resteasy.reactive.MultipartForm; @Path("/multipart/echo") @RegisterRestClient @@ -16,5 +15,5 @@ public interface MultipartService { @POST @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces(MediaType.TEXT_PLAIN) - String sendMultipartData(@MultipartForm ClientMultipartBody data); + String sendMultipartData(ClientMultipartBody data); } diff --git a/http/rest-client-reactive/src/main/java/io/quarkus/ts/http/restclient/reactive/files/FileClient.java b/http/rest-client-reactive/src/main/java/io/quarkus/ts/http/restclient/reactive/files/FileClient.java index c3ee3dd00..eabcfbdc2 100644 --- a/http/rest-client-reactive/src/main/java/io/quarkus/ts/http/restclient/reactive/files/FileClient.java +++ b/http/rest-client-reactive/src/main/java/io/quarkus/ts/http/restclient/reactive/files/FileClient.java @@ -11,7 +11,6 @@ import org.eclipse.microprofile.rest.client.annotation.RegisterClientHeaders; import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; -import org.jboss.resteasy.reactive.MultipartForm; import io.smallrye.mutiny.Uni; @@ -50,6 +49,6 @@ public interface FileClient { @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces(MediaType.TEXT_PLAIN) @Path("/upload-multipart") - String sendMultipart(@MultipartForm FileWrapper data); + String sendMultipart(FileWrapper data); } diff --git a/http/rest-client-reactive/src/main/java/io/quarkus/ts/http/restclient/reactive/files/FileResource.java b/http/rest-client-reactive/src/main/java/io/quarkus/ts/http/restclient/reactive/files/FileResource.java index e5032b9a2..18bd6ec18 100644 --- a/http/rest-client-reactive/src/main/java/io/quarkus/ts/http/restclient/reactive/files/FileResource.java +++ b/http/rest-client-reactive/src/main/java/io/quarkus/ts/http/restclient/reactive/files/FileResource.java @@ -16,7 +16,6 @@ import javax.ws.rs.core.MediaType; import org.eclipse.microprofile.config.inject.ConfigProperty; -import org.jboss.resteasy.reactive.MultipartForm; import org.jboss.resteasy.reactive.RestResponse; import io.quarkus.logging.Log; @@ -61,7 +60,7 @@ public Uni upload(File body) { @Produces(MediaType.TEXT_PLAIN) @Path("/upload-multipart") @Blocking - public String uploadMultipart(@MultipartForm FileWrapper body) { + public String uploadMultipart(FileWrapper body) { deathRow.add(body.file); return utils.getSum(body.file.getAbsoluteFile().toPath()); }