I am trying to write Resteasy Client Class to make simple POST multipart/form-data request to upload file. So POST request must contain Content-Disposition: form-data; name="files"; filename="myfile.txt" parameters.
I am able to set this statically with @PartFilename annotation for field in entity (value) class. like this
public class UploadStreamMultipartBody {
@FormParam("files")
@PartFilename(value = "myfile.txt")
@PartType(MediaType.APPLICATION_OCTET_STREAM)
public InputStream file;
}
But I cannot realize how to make it dynamically so I can provide file name in RUNTIME Cause annotation value is read once in compile time.