Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions replacements/scanFileAdvancedCall.new.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private com.squareup.okhttp.Call scanFileAdvancedValidateBeforeCall(java.io.Inpu
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call scanFileAdvancedCall(java.io.InputStream inputFile, String fileName, Boolean allowExecutables, Boolean allowInvalidFiles, Boolean allowScripts, Boolean allowPasswordProtectedFiles, Boolean allowMacros, Boolean allowXmlExternalEntities, Boolean allowInsecureDeserialization, Boolean allowHtml, Boolean allowUnsafeArchives, Boolean allowOleEmbeddedObject, String options, String restrictFileTypes, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
Object localVarPostBody = inputFile;

// create path and map variables
String localVarPath = "/virus/scan/file/advanced";
Expand Down Expand Up @@ -124,8 +124,6 @@ public com.squareup.okhttp.Call scanFileAdvancedCall(java.io.InputStream inputFi
localVarHeaderParams.put("restrictFileTypes", apiClient.parameterToString(restrictFileTypes));

Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (inputFile != null)
localVarFormParams.put("inputFile", inputFile);

final String[] localVarAccepts = {
"application/json", "text/json", "application/xml", "text/xml"
Expand All @@ -134,7 +132,7 @@ public com.squareup.okhttp.Call scanFileAdvancedCall(java.io.InputStream inputFi
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

final String[] localVarContentTypes = {
"multipart/form-data"
"application/octet-stream"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/com/cloudmersive/client/ScanApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ private com.squareup.okhttp.Call scanFileAdvancedValidateBeforeCall(java.io.Inpu
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call scanFileAdvancedCall(java.io.InputStream inputFile, String fileName, Boolean allowExecutables, Boolean allowInvalidFiles, Boolean allowScripts, Boolean allowPasswordProtectedFiles, Boolean allowMacros, Boolean allowXmlExternalEntities, Boolean allowInsecureDeserialization, Boolean allowHtml, Boolean allowUnsafeArchives, Boolean allowOleEmbeddedObject, String options, String restrictFileTypes, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
Object localVarPostBody = inputFile;

// create path and map variables
String localVarPath = "/virus/scan/file/advanced";
Expand Down Expand Up @@ -166,8 +166,6 @@ public com.squareup.okhttp.Call scanFileAdvancedCall(java.io.InputStream inputFi
localVarHeaderParams.put("restrictFileTypes", apiClient.parameterToString(restrictFileTypes));

Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (inputFile != null)
localVarFormParams.put("inputFile", inputFile);

final String[] localVarAccepts = {
"application/json", "text/json", "application/xml", "text/xml"
Expand All @@ -176,7 +174,7 @@ public com.squareup.okhttp.Call scanFileAdvancedCall(java.io.InputStream inputFi
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

final String[] localVarContentTypes = {
"multipart/form-data"
"application/octet-stream"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/com/cloudmersive/client/invoker/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,10 @@ public <T> T deserialize(Response response, Type returnType) throws ApiException
* @throws ApiException If fail to serialize the given object
*/
public RequestBody serialize(Object obj, String contentType) throws ApiException {
if (obj instanceof byte[]) {
if (obj instanceof java.io.InputStream) {
// Stream body parameter support with chunked transfer encoding
return createRequestBodyFromInputStream(MediaType.parse(contentType), (java.io.InputStream) obj);
} else if (obj instanceof byte[]) {
// Binary (byte array) body parameter support.
return RequestBody.create(MediaType.parse(contentType), (byte[]) obj);
} else if (obj instanceof File) {
Expand Down