dominikriemer commented on code in PR #1180:
URL: https://github.com/apache/streampipes/pull/1180#discussion_r1090518296


##########
streampipes-client/src/main/java/org/apache/streampipes/client/util/StreamPipesApiPath.java:
##########
@@ -51,10 +57,30 @@ public StreamPipesApiPath addToPath(String pathItem) {
     return this;
   }
 
+  public StreamPipesApiPath withQueryParameters(Map<String, String> 
queryParameters) {
+    this.queryParameters.putAll(queryParameters);
+    return this;
+  }
+
   @Override
   public String toString() {
     StringJoiner joiner = new StringJoiner("/");
     pathItems.forEach(joiner::add);
-    return joiner.toString();
+    return appendQueryParameters(joiner.toString());
+  }
+
+  private String appendQueryParameters(String input) {
+
+    StringJoiner joiner = new StringJoiner("&");
+    for (Map.Entry<String, String> parameter : queryParameters.entrySet()) {
+      joiner.add(URLEncoder.encode(parameter.getKey(), StandardCharsets.UTF_8) 
+ "="

Review Comment:
   Can we extract the `URLEncoder.encode` operation to a separate method?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to