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 Summary

    Modifier and Type
    Method
    Description
    Normalizes the specified URL.
  • Method Details

    • normalize

      String normalize(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.