Class ServiceUriBuilder

java.lang.Object
com.sap.cloud.sdk.s4hana.connectivity.ServiceUriBuilder

@Deprecated public class ServiceUriBuilder extends Object
Deprecated.
This module will be discontinued, along with its classes and methods.
Used to build S/4HANA service URI, considering parameters such as base URI and relative path.
  • Constructor Details

    • ServiceUriBuilder

      public ServiceUriBuilder()
      Deprecated.
  • Method Details

    • prependSlashIfMissing

      protected static String prependSlashIfMissing(String path)
      Deprecated.
      Adds a slash ('/') as a prefix if it is not yet present.
      Parameters:
      path - The String to prefix with a slash.
      Returns:
      A String guaranteed to start with a slash.
    • appendSlashIfMissing

      protected static String appendSlashIfMissing(String path)
      Deprecated.
      Adds a slash ('/') as a suffix if it is not yet present.
      Parameters:
      path - The String to suffix with a slash.
      Returns:
      A String guaranteed to end with a slash.
    • encloseSlashesIfMissing

      protected static String encloseSlashesIfMissing(String path)
      Deprecated.
      Encloses the given String with a slash ('/') if they are not yet present.
      Parameters:
      path - The String to pre- and suffix with a slash.
      Returns:
      A String guaranteed to start and end with a slash.
    • build

      @Nonnull public URI build(@Nonnull URI baseUri, @Nonnull String relativePath)
      Deprecated.
      Builds a ERP service URI for a given relative path.
      Parameters:
      baseUri - The URI to replace/adjust the path property.
      relativePath - The relative path to be used.
      Returns:
      A new URI object based on the given baseUri, modified by adjusting the contained path with the given relativePath.
      Throws:
      IllegalArgumentException - If the new URI object could not be created, most likely due to a wrongly formatted relativePath.