Class DittoEncodingHelper


  • @Deprecated
    public final class DittoEncodingHelper
    extends Object
    Deprecated.
    DittoEncodingHelper is not longer in use.
    Utility for encoding/decoding parts used in names / IDs in Ditto, e.g. in:
    • Thing names
    • Feature IDs
    • Attribute keys
    • Feature property keys
    The following 8 characters are encoded as using them in the above places it would lead to require escaping, e.g. when accessing the HTTP API or using the DittoProtocol:
     / (slash)                used in HTTP urls and in DittoProtocol topic to delimit segments
     ? (question mark)        used in HTTP urls to start the query parameters
     # (hash mark)            used in HTTP urls to define a fragment identifier
     * (asterisk)             used in Ditto's search syntax in "like" queries
     , (comma)                used in Ditto's HTTP API to return several thing ID separated by commas
       (single whitespace)    must be escaped in HTTP urls to %20
     % (percent)              used to define an escaped character itself
     " (quotation marks)      often used as the delimiters around URI in text documents and protocol fields
     
    • Method Detail

      • encode

        public static String encode​(String encodeTarget)
        Deprecated.
        Encodes the given String by "percent-encoding" the harmful characters.
        Parameters:
        encodeTarget - the String to encode.
        Returns:
        the encoded String.
      • decode

        public static String decode​(String decodeTarget)
        Deprecated.
        Decodes the given String by decoding the "percent-encoded" characters in the passed decodeTarget.
        Parameters:
        decodeTarget - the String to decode.
        Returns:
        the decoded String.