(specifically RESTeasy)
It would be nice (for a single file) to have a method signature like:
public void upload(@FormParam("name") ..., @FormParam("file") file: InputStream)
...
doable? or am I dreaming? doesn’t seem to be that simple.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The key is to leverage the @MultipartForm annotations that comes with RESTEasy. This enables you to define a POJO that contains all the parts of the form and bind it easily.
Take for example the following POJO:
Now all you need to do is use this POJO in the entity which would look something like this: