File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed
main/java/io/helidon/webclient/api
test/java/io/helidon/webclient/api Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -171,15 +171,28 @@ public ClientUri skipUriEncoding(boolean skipUriEncoding) {
171171 }
172172
173173 /**
174- * Resolve the provided URI against this URI.
174+ * Replace {@code this} {@link ClientUri}'s URI with the result of resolving the provided {@link URI} against the
175+ * current one.
175176 *
176177 * @param uri URI to use
177- * @return updated instance
178+ * @return {@code this} updated instance
178179 */
179180 public ClientUri resolve (URI uri ) {
181+ return resolve (uri , false );
182+ }
183+
184+ /**
185+ * Resolve the provided {@link URI} against {@code this} {@link ClientUri}.
186+ *
187+ * @param uri
188+ * @param keepQueryParameters
189+ * @return {@code this} updated instance
190+ */
191+ public ClientUri resolve (URI uri , boolean keepQueryParameters ) {
180192 if (uri .isAbsolute ()) {
181193 this .uriBuilder = UriInfo .builder ();
182- this .query .clear ();
194+ if (!keepQueryParameters )
195+ this .query .clear ();
183196 }
184197
185198 if (uri .getScheme () != null ) {
Original file line number Diff line number Diff line change @@ -143,4 +143,10 @@ void testResolveQueryParameter() {
143143 assertThat (helper .scheme (), is ("https" ));
144144 assertThat (helper .query ().get ("k" ), is ("v" ));
145145 }
146+
147+ @ Test
148+ void myTest () throws Exception {
149+ ClientUri helper = ClientUri .create (URI .create ("http://localhost:8080/?k=v" ));
150+ System .out .println (helper .resolve (URI .create ("?a=b" )));
151+ }
146152}
You can’t perform that action at this time.
0 commit comments