Package org.geotools.data.ows
Class URLCheckers
Object
URLCheckers
Scans for all available URLChecker implementations, allows to register new ones, and provides a convenient method to
apply them on a given location.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidConfirm the location against all enabled URLChecker.static voidConfirms URI against all enabled URLCheckerstatic voidConfirm the URL against all enabled URLCheckerstatic voidderegister(URLChecker checker) Dynamically removes a new URLChecker, that might have been registered using theregister(URLChecker)method.static List<URLChecker>static StringNormalize location removing current directory.and parent directory..names.static voidregister(URLChecker checker) Dynamically register a new URLChecker.static voidreset()Re-initializes all static state, in particular, theURLCheckerservice registry
-
Field Details
-
LOGGER
-
-
Constructor Details
-
URLCheckers
public URLCheckers()
-
-
Method Details
-
reset
public static void reset()Re-initializes all static state, in particular, theURLCheckerservice registry -
register
Dynamically register a new URLChecker. The operation removes all instances of the same classes already present in the registry, if multiple instances are needed, one can use subclasses (eventually, anonymous inner classes) so that the instances are not sharing exactly the same class. -
deregister
Dynamically removes a new URLChecker, that might have been registered using theregister(URLChecker)method. -
getEnabledURLCheckers
- Returns:
- enabled list of org.geotools.data.ows.URLChecker implementations
-
confirm
Confirm the URL against all enabled URLChecker- Parameters:
url- to confirm using all available URLCheckers- Throws:
URLCheckerException- if the URL is not allowed for use
-
confirm
Confirms URI against all enabled URLChecker- Parameters:
uri- to evaluate using all available URLCheckers- Throws:
URLCheckerException- if the URI is not allowed for use
-
normalize
Normalize location removing current directory.and parent directory..names.Normalization uses
URI.normalize()for URI and URL locations. Path locations are normalized usingPath.normalize().This normalization method forces empty hostname
file:///pathrepresentation to provide a consistent location to check. RFC 8089 supports both empty hostnamefile:///pathandfile:/pathno hostname as references to the same absolute path.Keep in mind that file paths are standardized to
/on linux and\\on windows.- Parameters:
location- String(URI/URI/path)- Returns:
- normalized location, removing redundant
.and..path names if required
-
confirm
Confirm the location against all enabled URLChecker.- Parameters:
location- String(URI/URI/path) to be normalized and evaluated using all available URLCheckers- Throws:
URLCheckerException- if the location is not allowed for use
-