Interface UrlNormalizer

  • All Known Implementing Classes:
    DefaultUrlNormalizer

    public interface UrlNormalizer
    Simplifies URLs by removing parent directory references ("/../") and collapsing path segments. This performs purely string-based normalization without full URL parsing or validation.

    The normalization process iteratively removes "/../" segments by eliminating the preceding path segment, effectively resolving relative path traversals.

    This does not guarantee that the resulting URL is valid or reachable; it simply produces a more canonical representation of the input string.

    Author:
    Benjamin Bentmann
    • Method Detail

      • normalize

        java.lang.String normalize​(java.lang.String url)
        Normalizes the specified URL.
        Parameters:
        url - The URL to normalize, may be null.
        Returns:
        The normalized URL or null if the input was null.