@Test public void isPermittedResourceProtocol() { assertFalse(UrlUtils.isPermittedResourceProtocol("")); assertFalse(UrlUtils.isPermittedResourceProtocol(null)); assertTrue(UrlUtils.isPermittedResourceProtocol("http")); assertTrue(UrlUtils.isPermittedResourceProtocol("https")); assertTrue(UrlUtils.isPermittedResourceProtocol("data")); assertTrue(UrlUtils.isPermittedResourceProtocol("file")); assertFalse(UrlUtils.isPermittedResourceProtocol("nielsenwebid")); }
public static boolean isPermittedResourceProtocol(@Nullable final String scheme) { return scheme != null && ( scheme.startsWith("http") || scheme.startsWith("https") || scheme.startsWith("file") || scheme.startsWith("data") || scheme.startsWith("javascript") || scheme.startsWith("about")); }
UrlUtils { public static boolean isPermittedResourceProtocol(@Nullable final String scheme) { return scheme != null && ( scheme.startsWith("http") || scheme.startsWith("https") || scheme.startsWith("file") || scheme.startsWith("data") || scheme.startsWith("javascript") || scheme.startsWith("about")); } }
UrlUtils { public static boolean isPermittedResourceProtocol(@Nullable final String scheme) { return scheme != null && ( scheme.startsWith("http") || scheme.startsWith("https") || scheme.startsWith("file") || scheme.startsWith("data") || scheme.startsWith("javascript") || scheme.startsWith("about")); }  }
UrlUtils { public static boolean isPermittedResourceProtocol(@Nullable final String scheme) { return scheme != null && ( scheme.startsWith("http") || scheme.startsWith("https") || scheme.startsWith("file") || scheme.startsWith("data") || scheme.startsWith("javascript") || scheme.startsWith("about")); }  static String normalize(@NonNull String input); static boolean isUrl(String url); static boolean isValidSearchQueryUrl(String url); static boolean isHttpOrHttps(String url); static String createSearchUrl(Context context, String searchTerm); static String stripUserInfo(@Nullable String url); static boolean isPermittedResourceProtocol(@Nullable final String scheme); static boolean isSupportedProtocol(@Nullable final String scheme); static boolean isInternalErrorURL(final String url); static boolean urlsMatchExceptForTrailingSlash(final String url1, final String url2); static String stripCommonSubdomains(@Nullable String host); static String stripScheme(@Nullable String url); static String stripSchemeAndSubDomain(String url); static boolean isLocalizedContent(@Nullable String url); }
UrlUtils { public static boolean isPermittedResourceProtocol(@Nullable final String scheme) { return scheme != null && ( scheme.startsWith("http") || scheme.startsWith("https") || scheme.startsWith("file") || scheme.startsWith("data") || scheme.startsWith("javascript") || scheme.startsWith("about")); }  static String normalize(@NonNull String input); static boolean isUrl(String url); static boolean isValidSearchQueryUrl(String url); static boolean isHttpOrHttps(String url); static String createSearchUrl(Context context, String searchTerm); static String stripUserInfo(@Nullable String url); static boolean isPermittedResourceProtocol(@Nullable final String scheme); static boolean isSupportedProtocol(@Nullable final String scheme); static boolean isInternalErrorURL(final String url); static boolean urlsMatchExceptForTrailingSlash(final String url1, final String url2); static String stripCommonSubdomains(@Nullable String host); static String stripScheme(@Nullable String url); static String stripSchemeAndSubDomain(String url); static boolean isLocalizedContent(@Nullable String url);  }