Class URLValidator


  • @Immutable
    public final class URLValidator
    extends Object
    Check if a URL is valid.
    Author:
    Philip Helger
    • Method Detail

      • getUnifiedURL

        @Nullable
        public static String getUnifiedURL​(@Nullable
                                           String sURL)
        Get the unified version of a URL. It trims leading and trailing spaces and lower-cases the URL.
        Parameters:
        sURL - The URL to unify. May be null.
        Returns:
        The unified URL or null if the input address is null.
      • isValid

        public static boolean isValid​(@Nullable
                                      String sURL)
        Checks if a value is a valid URL.
        Parameters:
        sURL - The value validation is being performed on. A null or empty value is considered invalid.
        Returns:
        true if URL is valid, false otherwise.