public class DefaultURLValidator extends Object implements URLValidator
Proxy.NO_PROXY
is used. Connection to URL [<url>] was successfull." message is returned.
PropertyFrameworkGlobals.getDefaultProxy()
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_TESTCONNECTION_TIMEOUT_IN_MILLISECONDS
Default connection timeout value in milliseconds.
|
Constructor and Description |
---|
DefaultURLValidator()
Default constructor using DEFAULT_TESTCONNECTION_TIMEOUT_IN_MILLISECONDS value and Proxy.NO_PROXY
|
DefaultURLValidator(int timeoutMilliseconds)
Constructor with timeout value,
|
DefaultURLValidator(int timeoutMilliseconds,
Proxy proxy)
Constructor.
|
DefaultURLValidator(Proxy proxy)
Constructor, using default timeout.
|
Modifier and Type | Method and Description |
---|---|
Proxy |
getProxy()
Gets the proxy setup for this URL, default is null.
|
int |
getTimeoutMilliseconds()
Gets the connect timeout value in milliseconds.
|
String |
validateUrl(String propertyName,
URL url,
Proxy proxy)
Validates that a valid connection can be made to the URL.
|
public static final int DEFAULT_TESTCONNECTION_TIMEOUT_IN_MILLISECONDS
public DefaultURLValidator()
public DefaultURLValidator(int timeoutMilliseconds)
timeoutMilliseconds
- connection timeout value in milliseconds.Proxy.NO_PROXY
public DefaultURLValidator(Proxy proxy)
proxy
- the proxy settingsDEFAULT_TESTCONNECTION_TIMEOUT_IN_MILLISECONDS
public DefaultURLValidator(int timeoutMilliseconds, Proxy proxy)
timeoutMilliseconds
- a timeout value in milliseconds.proxy
- a Proxy instance, if null
than Proxy.NO_PROXY is used.Proxy.NO_PROXY
public int getTimeoutMilliseconds()
URLValidator
getTimeoutMilliseconds
in interface URLValidator
public Proxy getProxy()
MarkerProxyDependent
getProxy
in interface MarkerProxyDependent
public String validateUrl(String propertyName, URL url, Proxy proxy) throws PropertyException
URLValidator
validateUrl
in interface URLValidator
propertyName
- the property name.url
- the url to validate.proxy
- an optional Proxy, if no proxy use
PropertyException
- if the connection attempt failed.Proxy.NO_PROXY