Class CanonicalPath


  • public final class CanonicalPath
    extends java.lang.Object
    Utility for deriving a deterministic canonical path from an ad media URL.

    Rules: 1. Parses URL using URI, keeping only the path (dropping scheme, host, port, query, fragment). 2. URL-decodes %XX percent encodings once (preserving +). 3. Removes volatile parameters, key-value pairs, timestamps, UUIDs, and 16+ char hex strings. 4. Resolves . and .., collapses duplicate slashes, ensures leading / and no trailing /.

    Both the SDK and the Pulse backend must apply identical rules and use the same ruleVersion.

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String from​(java.lang.String mediaUrl)  
      static java.lang.String from​(java.lang.String mediaUrl, CanonicalPathConfig config)
      Generates a deterministic canonical path from the given media URL.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • from

        public static java.lang.String from​(java.lang.String mediaUrl,
                                            CanonicalPathConfig config)
        Generates a deterministic canonical path from the given media URL.
        Parameters:
        mediaUrl - The raw media file URL string (nullable).
        config - Configuration containing volatile keys and rule version.
        Returns:
        Canonical path string starting with / (or "" if invalid/empty).
      • from

        public static java.lang.String from​(java.lang.String mediaUrl)