Class HttpUrlChecker
- java.lang.Object
-
- org.ametys.plugins.core.impl.checker.HttpUrlChecker
-
- All Implemented Interfaces:
ItemChecker
,Configurable
public class HttpUrlChecker extends Object implements ItemChecker, Configurable
Checks if the url written is correct and if it allows to establish a connection with the given configuration.
-
-
Field Summary
Fields Modifier and Type Field Description protected String
_additionnalURL
Something to add to the parameterprotected String
_method
The methodprotected String
_okCodes
The acceptable response codesprotected Map<String,String>
_requestHeaderValues
The values the header must haveprotected Map<String,String>
_responseHeaderValues
The values the header must haveprotected int
_timeout
The timeoutprotected String
_userAgent
The user agent
-
Constructor Summary
Constructors Constructor Description HttpUrlChecker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
_testHeaders(HttpURLConnection httpUrlConnection)
private void
_testResponseCode(HttpURLConnection httpUrlConnection, int responseCode)
void
check(List<String> values)
Checks the validity of the parameters.void
configure(Configuration configuration)
-
-
-
Field Detail
-
_userAgent
protected String _userAgent
The user agent
-
_timeout
protected int _timeout
The timeout
-
_requestHeaderValues
protected Map<String,String> _requestHeaderValues
The values the header must have
-
_responseHeaderValues
protected Map<String,String> _responseHeaderValues
The values the header must have
-
_additionnalURL
protected String _additionnalURL
Something to add to the parameter
-
-
Constructor Detail
-
HttpUrlChecker
public HttpUrlChecker()
-
-
Method Detail
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
check
public void check(List<String> values) throws ItemCheckerTestFailureException
Description copied from interface:ItemChecker
Checks the validity of the parameters.- Specified by:
check
in interfaceItemChecker
- Parameters:
values
- the values to test- Throws:
ItemCheckerTestFailureException
- if the test failed
-
_testHeaders
private void _testHeaders(HttpURLConnection httpUrlConnection) throws ItemCheckerTestFailureException
- Throws:
ItemCheckerTestFailureException
-
_testResponseCode
private void _testResponseCode(HttpURLConnection httpUrlConnection, int responseCode) throws ItemCheckerTestFailureException, IOException
-
-