Skip to content

Commit

Permalink
UriComponentsBuilder Javadoc update
Browse files Browse the repository at this point in the history
  • Loading branch information
rstoyanchev authored and zx20110729 committed Feb 18, 2022
1 parent 07561b9 commit bb798af
Showing 1 changed file with 13 additions and 5 deletions.
Expand Up @@ -182,7 +182,13 @@ public static UriComponentsBuilder fromPath(String path) {
}

/**
* Create a builder that is initialized with the given {@code URI}.
* Create a builder that is initialized from the given {@code URI}.
* <p><strong>Note:</strong> the components in the resulting builder will be
* in fully encoded (raw) form and further changes must also supply values
* that are fully encoded, for example via methods in {@link UriUtils}.
* In addition please use {@link #build(boolean)} with a value of "true" to
* build the {@link UriComponents} instance in order to indicate that the
* components are encoded.
* @param uri the URI to initialize with
* @return the new {@code UriComponentsBuilder}
*/
Expand Down Expand Up @@ -379,11 +385,13 @@ public UriComponents build() {
}

/**
* Build a {@code UriComponents} instance from the various components
* contained in this builder.
* @param encoded whether all the components set in this builder are
* encoded ({@code true}) or not ({@code false})
* Variant of {@link #build()} to create a {@link UriComponents} instance
* when components are already fully encoded. This is useful for example if
* the builder was created via {@link UriComponentsBuilder#fromUri(URI)}.
* @param encoded whether the components in this builder are already encoded
* @return the URI components
* @throws IllegalArgumentException if any of the components contain illegal
* characters that should have been encoded.
*/
public UriComponents build(boolean encoded) {
return buildInternal(encoded ?
Expand Down

0 comments on commit bb798af

Please sign in to comment.