Package org.apache.nifi.processor.util
Class URLValidator
java.lang.Object
org.apache.nifi.processor.util.URLValidator
- All Implemented Interfaces:
Validator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final Pattern
private static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic URL
This method provides an alternative to the use of java.net.URI's single argument constructor and 'create' method.validate
(String subject, String input, ValidationContext context)
-
Field Details
-
SCHEME_PATTERN
- See Also:
-
USERINFO_PATTERN
- See Also:
-
HOST_IPV4_PATTERN
- See Also:
-
HOST_IPV6_PATTERN
- See Also:
-
HOST_PATTERN
- See Also:
-
PORT_PATTERN
- See Also:
-
PATH_PATTERN
- See Also:
-
QUERY_PATTERN
- See Also:
-
LAST_PATTERN
- See Also:
-
URI_PATTERN
-
-
Constructor Details
-
URLValidator
public URLValidator()
-
-
Method Details
-
validate
-
createURL
This method provides an alternative to the use of java.net.URI's single argument constructor and 'create' method. The drawbacks of the java.net.URI's single argument constructor and 'create' method are:- They do not provide quoting in the path section for any character not in the unreserved, punct, escaped, or other categories, and not equal to the slash character ('/') or the commercial-at character ('@').
- They do not provide quoting for any illegal characters found in the query and fragment sections.
- Parameters:
url
- String representing a URL.- Returns:
- Instance of java.net.URL
- Throws:
MalformedURLException
- if unable to create a URL from the given String representation
-