Open jimma opened 2 years ago
Not solely in a form of an interface, the users would need to implement it.
From the message body provider perspective, I do not see much difference, maybe I miss something.
From the user perspective, it might be better to use
MultiPartEntity multipartEntity = new MultiPartEntity(parts)
. than
GenericEntity<List<EntityPart>> genericEntity = new GenericEntity<>(parts){};
.
What is the close
method doing?
Not solely in a form of an interface, the users would need to implement it. From the message body provider perspective, I do not see much difference, maybe I miss something.
I think the MessageBodyReader/Writer only needs to check this MultiPartEntity
. If user put these EntityParts in a Map
, the message body provider which check this List
type doesn't work.
What is the
close
method doing?
It can dispose/close the underlying InputStream which isn't closed or delete any temporary files if there is any.
I saw we added javadoc to mention the GenericEntity for a List of EntityPart: the https://github.com/eclipse-ee4j/jaxrs-api/blob/master/jaxrs-api/src/main/java/jakarta/ws/rs/core/EntityPart.java#L45, and is it better we define a MultiPartEntity like for a strong type ? Then MsgBodyReader/Writer can clearly know it has a list of EntityPart instead of others.