Class IdUtil

java.lang.Object
com.symphony.bdk.core.util.IdUtil

@API(status=EXPERIMENTAL) public class IdUtil extends Object
Helper class providing Base64 id conversion. Useful for stream or message ids.
  • Constructor Details

    • IdUtil

      public IdUtil()
  • Method Details

    • toUrlSafeIdIfNeeded

      public static String toUrlSafeIdIfNeeded(String base64Id)
      Convert the Base64 id to its URL-safe Base64 version if it contains non URL-safe characters.
      Parameters:
      base64Id - Base64 id.
      Returns:
      Base64 URL-safe id.
    • toUrlSafeId

      public static String toUrlSafeId(String base64Id)
      Convert the stream id to the corresponding URL-safe encoded stream id.

      Example of usage:

      
         String urlSafeStreamId = StreamUtil.toUrlSafeStreamId("XlU3OH9eVMzq+yss7M/xyn///oxwgbtGbQ==");
       

    • fromUrlSafeId

      public static String fromUrlSafeId(String urlSafeBase64Id)
      Convert the URL-safe encoded stream id to the corresponding original stream id.

      Example of usage:

      
         String streamId = StreamUtil.fromUrlSafeStreamId("XlU3OH9eVMzq-yss7M_xyn___oxwgbtGbQ");