Class URIHelper

java.lang.Object
org.jweaver.crawler.internal.util.URIHelper

public class URIHelper extends Object
The URIHelper class provides utility methods for handling and validating URIs. It includes methods for checking URI validity, determining if a URI is external, transforming URIs for comparison, and checking if a URI's content type is allowed.
  • Method Details

    • isValidUri

      public static boolean isValidUri(String url)
      Check if the provided URI is valid
      Parameters:
      url - Url to validate
      Returns:
      true if the provided URI is valid
    • isExternalUri

      public static boolean isExternalUri(String baseUrl, String childUrl)
      Checks if the child URI is external to the base URI.
      Parameters:
      baseUrl - The base URL.
      childUrl - The child URL.
      Returns:
      True if the child URI is external, false otherwise.
    • isAllowedUrl

      public static boolean isAllowedUrl(String uri)
      Checks if a URL's extension is allowed.
      Parameters:
      uri - The URI to check.
      Returns:
      True if the URL's extension is allowed, false otherwise.
    • isAllowedContentType

      public static boolean isAllowedContentType(String contentType)
      Checks if a content type is allowed.
      Parameters:
      contentType - The content type to check.
      Returns:
      True if the content type is allowed, false otherwise.