class UrlTracker
extends java.lang.Object
Details of the implementation are arguable.
Modifier and Type | Field and Description |
---|---|
private java.util.Set |
blockedSet_ |
private java.lang.String[] |
localhostNames_ |
private java.util.logging.Logger |
logger_ |
private java.util.Set |
permittedSet_ |
Constructor and Description |
---|
UrlTracker()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
private boolean |
isLocalHost(java.lang.String host)
Determines whether a hostname appears to reference the localhost.
|
protected boolean |
isSensitive(java.net.URL url)
Indicates whether a given URL is potentially sensitive.
|
boolean |
isUrlPermitted(java.net.URL url)
Indicates whether access to a given URL should be permitted,
according to the strategy implemented by this class,
from a Web Profile client.
|
void |
noteIncomingUrl(java.net.URL url)
Note that a URL has been communicated to a Web Profile client
from the outside world.
|
void |
noteOutgoingUrl(java.net.URL url)
Note that a Web Profile client has communicated a URL to the
outside world.
|
private final java.util.Set permittedSet_
private final java.util.Set blockedSet_
private final java.lang.String[] localhostNames_
private final java.util.logging.Logger logger_
public void noteIncomingUrl(java.net.URL url)
url
- incoming URLpublic void noteOutgoingUrl(java.net.URL url)
url
- outgoing URLpublic boolean isUrlPermitted(java.net.URL url)
url
- URL to assessprotected boolean isSensitive(java.net.URL url)
url
- URL to assessprivate boolean isLocalHost(java.lang.String host)
host
- hostname from URL