You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by GitBox <gi...@apache.org> on 2020/12/05 13:31:24 UTC

[GitHub] [httpcomponents-core] ok2c commented on a change in pull request #234: Add appendPath and appendPathSegments methods to URIBuilder

ok2c commented on a change in pull request #234:
URL: https://github.com/apache/httpcomponents-core/pull/234#discussion_r536762219



##########
File path: httpcore5/src/main/java/org/apache/hc/core5/net/URIBuilder.java
##########
@@ -499,6 +499,18 @@ public URIBuilder setPath(final String path) {
         return this;
     }
 
+    /**
+     * Appends path to URI. The value is expected to be unescaped and may contain non ASCII characters.
+     *
+     * @return this.
+     */
+    public URIBuilder appendPath(final String path) {
+        final List<String> segments = new ArrayList<>(getPathSegments());
+        segments.addAll(path != null ? splitPath(path) : new ArrayList<String>());
+        setPathSegments(segments);

Review comment:
       @larshelge Should not it be possible to re-use `#setPathSegments` here?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org