List of utility methods to do URL Sanitize
String | sanitizeUrlWithProtocol(String url, String defaultProtocol) Sanitizes a given URL to include a protocol prefix. if (url.contains("://") && url.indexOf('/') - 1 == url.indexOf("://")) { return url; } else { return defaultProtocol + "://" + url; |