Skip to content

Commit

Permalink
CLI: Fix CustomFilesCommandExecutor upload problems #4843
Browse files Browse the repository at this point in the history
  • Loading branch information
juanfeSanahuja committed Aug 11, 2023
1 parent 41b33a1 commit 7b0a294
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public CustomFilesCommandExecutor(ObjectMap options, String token, ClientConfigu

public RestResponse<File> upload() throws Exception {
// ObjectMap params = new ObjectMap()
options.append("fileFormat", ParamUtils.defaultString(String.valueOf(options.get("fileFormat")), File.Format.UNKNOWN.toString()))
.append("bioformat", ParamUtils.defaultString(String.valueOf(options.get("bioformat")), File.Bioformat.UNKNOWN.toString()));
options.append("fileFormat", options.getString("fileFormat", File.Format.UNKNOWN.toString()))
.append("bioformat", options.getString("bioformat", File.Bioformat.UNKNOWN.toString()));
// //If the DEPRECATED parameter fileFormat has set we only override it if the new parameter format is also set
// params.append("fileFormat", ParamUtils.defaultString(commandOptions.format, params.getString("fileFormat")));
// params.putIfNotEmpty("study", commandOptions.study);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ protected <T> RestResponse<T> callUploadRest(WebTarget path, Map<String, Object>
client.property(ClientProperties.READ_TIMEOUT, DEFAULT_UPLOAD_TIMEOUT);
path.register(MultiPartFeature.class);
path.property(ClientProperties.REQUEST_ENTITY_PROCESSING, RequestEntityProcessing.CHUNKED);

final FileDataBodyPart filePart = new FileDataBodyPart("file", new File(filePath));
FormDataMultiPart formDataMultiPart = new FormDataMultiPart();
// Add the rest of the parameters to the form
Expand Down

0 comments on commit 7b0a294

Please sign in to comment.