-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Client Generation Does not Revert Fix
Client generation does not revert the fix which allows for files to be handled by the client.
- Loading branch information
1 parent
3db5539
commit a4c6247
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
diff --git a/vcell-restclient/src/main/java/org/vcell/restclient/api/SpatialResourceApi.java b/vcell-restclient/src/main/java/org/vcell/restclient/api/SpatialResourceApi.java | ||
index 587470500..250d4cbee 100644 | ||
--- a/vcell-restclient/src/main/java/org/vcell/restclient/api/SpatialResourceApi.java | ||
+++ b/vcell-restclient/src/main/java/org/vcell/restclient/api/SpatialResourceApi.java | ||
@@ -12,6 +12,8 @@ | ||
|
||
package org.vcell.restclient.api; | ||
|
||
+import org.apache.commons.io.FileUtils; | ||
+import org.apache.commons.lang.RandomStringUtils; | ||
import org.vcell.restclient.ApiClient; | ||
import org.vcell.restclient.ApiException; | ||
import org.vcell.restclient.ApiResponse; | ||
@@ -119,11 +121,14 @@ public class SpatialResourceApi { | ||
if (localVarResponse.statusCode()/ 100 != 2) { | ||
throw getApiException("retrieveFiniteVolumeInputFromSpatialModel", localVarResponse); | ||
} | ||
- return new ApiResponse<File>( | ||
- localVarResponse.statusCode(), | ||
- localVarResponse.headers().map(), | ||
- localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<File>() {}) // closes the InputStream | ||
- ); | ||
+ InputStream inputStream = localVarResponse.body(); | ||
+ File file = File.createTempFile("finite-volume-input-" + RandomStringUtils.randomAlphabetic(10), ".tmp"); | ||
+ FileUtils.copyInputStreamToFile(inputStream, file); | ||
+ return new ApiResponse<File>( | ||
+ localVarResponse.statusCode(), | ||
+ localVarResponse.headers().map(), | ||
+ localVarResponse.body() == null ? null : file // closes the InputStream | ||
+ ); | ||
} finally { | ||
} | ||
} catch (IOException e) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters