types/src/main/java/com/google/common/html/types/SafeUrls.java
public static SafeUrl sanitize(String url, Set<CustomSafeUrlScheme> extraAllowedSchemes) {
    if (!isSafeUrl(url, extraAllowedSchemes)) {
      return SafeUrl.INNOCUOUS;
    }
    return create(url);
  }
public static SafeUrl sanitize(String url, Set<CustomSafeUrlScheme> extraAllowedSchemes) {
    if (!isSafeUrl(url, extraAllowedSchemes)) {
      return SafeUrl.INNOCUOUS;
    }
    return create(url);
  }
public static SafeUrl sanitize ( String url , Set < CustomSafeUrlScheme > extraAllowedSchemes ) { if ( ! isSafeUrl ( url , extraAllowedSchemes ) ) { return SafeUrl . INNOCUOUS ; } return create ( url ) ; }
Creates a SafeUrl object from the given {@code url}, validating that the input string matches
a pattern of commonly used safe URLs. If {@code url} fails validation, this method returns a
SafeUrl, {@link SafeUrl#INNOCUOUS}, which contains an innocuous string,
{@link SafeUrl#INNOCUOUS_STRING}.

<p>{@code url} is sanitized as in {@link #sanitize(String)}, additionally permitting the
custom schemes listed in {@code extraAllowedSchemes}.
Creates a SafeUrl object from the given { @code url } validating that the input string matches a pattern of commonly used safe URLs . If { @code url } fails validation this method returns a SafeUrl { @link SafeUrl#INNOCUOUS } which contains an innocuous string { @link SafeUrl#INNOCUOUS_STRING } .