mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-06-02 06:50:53 +00:00
update java resteasy samples
This commit is contained in:
parent
6ea8ff3a17
commit
026fa514c3
@ -493,12 +493,12 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
if (param.getValue() instanceof File) {
|
||||
File file = (File) param.getValue();
|
||||
try {
|
||||
multipart.addFormData(param.getValue().toString(),new FileInputStream(file),MediaType.APPLICATION_OCTET_STREAM_TYPE);
|
||||
multipart.addFormData(param.getKey(),new FileInputStream(file),MediaType.APPLICATION_OCTET_STREAM_TYPE);
|
||||
} catch (FileNotFoundException e) {
|
||||
throw new ApiException("Could not serialize multipart/form-data "+e.getMessage());
|
||||
}
|
||||
} else {
|
||||
multipart.addFormData(param.getValue().toString(),param.getValue().toString(),MediaType.APPLICATION_OCTET_STREAM_TYPE);
|
||||
multipart.addFormData(param.getKey(),param.getValue().toString(),MediaType.APPLICATION_OCTET_STREAM_TYPE);
|
||||
}
|
||||
}
|
||||
GenericEntity<MultipartFormDataOutput> genericEntity = new GenericEntity<MultipartFormDataOutput>(multipart) { };
|
||||
|
Loading…
x
Reference in New Issue
Block a user