Class HostnameFilter
java.lang.Object
com.github.markusbernhardt.proxy.selector.whitelist.HostnameFilter
- All Implemented Interfaces:
UriFilter
Tests if a host name of a given URI matches some criteria.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
private HostnameFilter.Mode
private static final String
private String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
acceptprivate void
Extracts the protocol if one is given to initialize the protocol matcher.private boolean
isProtocolMatching
(URI uri) Applies the protocol filter if available to see if we have a match.
-
Field Details
-
PROTOCOL_ENDING
- See Also:
-
matchTo
-
protocolFilter
-
mode
-
-
Constructor Details
-
HostnameFilter
Constructor- Parameters:
mode
- the filter mode.matchTo
- the match criteria.
-
-
Method Details
-
extractProtocolFilter
private void extractProtocolFilter()Extracts the protocol if one is given to initialize the protocol matcher. -
accept
accept -
isProtocolMatching
Applies the protocol filter if available to see if we have a match.- Parameters:
uri
- to test for a correct protocol.- Returns:
- true if passed else false.
-