Class UriPathMerger
java.lang.Object
com.sap.cloud.sdk.cloudplatform.connectivity.UriPathMerger
Utility class offering the ability to merge two URIs.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
UriPathMerger
public UriPathMerger()
-
-
Method Details
-
merge
@Nonnull public URI merge(@Nonnull URI primaryUri, @Nullable URI secondaryUri) throws DestinationPathsNotMergeableException Merges twoURIaddresses, checking that bothURIshave the same scheme, host and port. If secondary URI is absolute (i.e. it has schema and host definition) then path of primary URI is omitted. Otherwise, the paths are appended. Query parameters are combined. Fragment of secondary URI is preferred.- Parameters:
primaryUri- The primaryURI, usually pointing to the destination.secondaryUri- The secondaryURI, usually identifying the request at runtime.- Returns:
- The merged
URI, representing the given request executed on the given destination. - Throws:
DestinationPathsNotMergeableException- If either of the request paths of the given URIs arenullor the URIs differ in the used schema, host, or port.
-