Class URIHelper
java.lang.Object
org.jweaver.crawler.internal.util.URIHelper
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 Summary
Modifier and TypeMethodDescriptionstatic booleanisAllowedContentType(String contentType) Checks if a content type is allowed.static booleanisAllowedUrl(String uri) Checks if a URL's extension is allowed.static booleanisExternalUri(String baseUrl, String childUrl) Checks if the child URI is external to the base URI.static booleanisValidUri(String url) Check if the provided URI is valid
-
Method Details
-
isValidUri
Check if the provided URI is valid- Parameters:
url- Url to validate- Returns:
- true if the provided URI is valid
-
isExternalUri
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
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
Checks if a content type is allowed.- Parameters:
contentType- The content type to check.- Returns:
- True if the content type is allowed, false otherwise.
-