My problem is, I have a file that has a ‘multipart/mixed’ structure. I need to read that file e.g. as ‘org.glassfish.jersey.media.multipart.MultiPart’ and do some filtering (exclude some body parts) and then send it to a http server.
InputStream file = new FileInputStream("multipart.file");
org.glassfish.jersey.media.multipart.MultiPart multiPartEntity = parseAndFilter();
jakarta.ws.rs.client.Client client = ...;
WebTarget webTarget = client.target(location).register(MultiPartFeature.class);
Entity<?> entity = Entity.entity(multiPartEntity, MediaType.valueOf("multipart/mixed"));
Response response = webTarget.request().put(entity);
...
Tried org.glassfish.jersey.media.multipart.internal.MultiPartReaderClientSide but I was not able to get that working due to unable init jakarta.ws.rs.ext.Providers.
Parsing that file by hand and exclude some body parts, can be done, but then the problem still exist to parse that file as ‘org.glassfish.jersey.media.multipart.MultiPart’.