Skip to content

Commit

Permalink
Client Generation Does not Revert Fix
Browse files Browse the repository at this point in the history
Client generation does not revert the fix which allows for files to be handled by the client.
  • Loading branch information
AvocadoMoon committed Jan 29, 2025
1 parent 3db5539 commit a4c6247
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
33 changes: 33 additions & 0 deletions tools/SpatialResourceApi.patch
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) {
4 changes: 4 additions & 0 deletions tools/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ if ! git apply "${scriptDir}/AdminResourceApi.patch"; then
echo "Failed to apply AdminResourceApi.patch"
exit 1
fi
if ! git apply "${scriptDir}/SpatialResourceApi.patch"; then
echo "Failed to apply SpatialResourceApi.patch"
exit 1
fi
popd || { echo "Failed to return to the previous directory"; exit 1; }


Expand Down

0 comments on commit a4c6247

Please sign in to comment.