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 void
Confirm the location against all enabled URLChecker.static void
Confirms URI against all enabled URLCheckerstatic void
Confirm the URL against all enabled URLCheckerstatic void
deregister
(URLChecker checker) Dynamically removes a new URLChecker, that might have been registered using theregister(URLChecker)
method.static List<URLChecker>
static String
Normalize location removing current directory.
and parent directory..
names.static void
register
(URLChecker checker) Dynamically register a new URLChecker.static void
reset()
Re-initializes all static state, in particular, theURLChecker
service registry
-
Field Details
-
LOGGER
-
-
Constructor Details
-
URLCheckers
public URLCheckers()
-
-
Method Details
-
reset
public static void reset()Re-initializes all static state, in particular, theURLChecker
service 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:///path
representation to provide a consistent location to check. RFC 8089 supports both empty hostnamefile:///path
andfile:/path
no 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
-