mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-06-03 23:40:58 +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) {
|
if (param.getValue() instanceof File) {
|
||||||
File file = (File) param.getValue();
|
File file = (File) param.getValue();
|
||||||
try {
|
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) {
|
} catch (FileNotFoundException e) {
|
||||||
throw new ApiException("Could not serialize multipart/form-data "+e.getMessage());
|
throw new ApiException("Could not serialize multipart/form-data "+e.getMessage());
|
||||||
}
|
}
|
||||||
} else {
|
} 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) { };
|
GenericEntity<MultipartFormDataOutput> genericEntity = new GenericEntity<MultipartFormDataOutput>(multipart) { };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user