public class HttpAccess extends Object
| Constructor and Description |
|---|
HttpAccess() |
HttpAccess(ResponseStatusValidator validator) |
| Modifier and Type | Method and Description |
|---|---|
String |
doDelete(String strUrl,
fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator,
List<String> listElements,
Map<String,String> headersRequest,
Map<String,String> headersResponse)
Send a DELETE HTTP request to an url and return the response content.
|
String |
doGet(String strUrl)
Send a GET HTTP request to an Url and return the response content.
|
String |
doGet(String strUrl,
fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator,
List<String> listElements)
Send a GET HTTP request to an Url and return the response content.
|
String |
doGet(String strUrl,
fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator,
List<String> listElements,
Map<String,String> headers)
Send a GET HTTP request to an Url and return the response content.
|
String |
doGet(String strUrl,
fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator,
List<String> listElements,
Map<String,String> headersRequest,
Map<String,String> headersResponse)
Send a GET HTTP request to an Url and return the response content.
|
String |
doPost(String strUrl,
Map<String,String> params)
Send a POST HTTP request to an url and return the response content.
|
String |
doPost(String strUrl,
Map<String,String> params,
fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator,
List<String> listElements)
Send a POST HTTP request to an url and return the response content.
|
String |
doPost(String strUrl,
Map<String,String> params,
fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator,
List<String> listElements,
Map<String,String> headersRequest)
Send a POST HTTP request to an url and return the response content.
|
String |
doPost(String strUrl,
Map<String,String> params,
fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator,
List<String> listElements,
Map<String,String> headersRequest,
Map<String,String> headersResponse)
Send a POST HTTP request to an url and return the response content.
|
String |
doPostJSON(String strUrl,
String strJSON,
Map<String,String> headersRequest,
Map<String,String> headersResponse)
Do post json.
|
String |
doPostJSON(String strUrl,
String strJSON,
fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator,
List<String> listElements,
Map<String,String> headersRequest,
Map<String,String> headersResponse)
Do post json.
|
String |
doPostMultiPart(String strUrl,
Map<String,List<String>> params,
Map<String,org.apache.commons.fileupload.FileItem> fileItems)
Send a POST HTTP request to an url and return the response content.
|
String |
doPostMultiPart(String strUrl,
Map<String,List<String>> params,
Map<String,org.apache.commons.fileupload.FileItem> fileItems,
fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator,
List<String> listElements)
Send a POST HTTP request to an url and return the response content.
|
String |
doPostMultiPart(String strUrl,
Map<String,List<String>> params,
Map<String,org.apache.commons.fileupload.FileItem> fileItems,
fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator,
List<String> listElements,
Map<String,String> headersRequest)
Send a POST HTTP request to an url and return the response content.
|
String |
doPostMultiPart(String strUrl,
Map<String,List<String>> params,
Map<String,org.apache.commons.fileupload.FileItem> fileItems,
fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator,
List<String> listElements,
Map<String,String> headersRequest,
Map<String,String> headersResponse)
Send a POST HTTP request to an url and return the response content.
|
String |
doPostMultiValues(String strUrl,
Map<String,List<String>> params)
Send a POST HTTP request to an url and return the response content.
|
String |
doPostMultiValues(String strUrl,
Map<String,List<String>> params,
fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator,
List<String> listElements)
Send a POST HTTP request to an url and return the response content.
|
String |
doPostMultiValues(String strUrl,
Map<String,List<String>> params,
fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator,
List<String> listElements,
Map<String,String> headersRequest)
Send a POST HTTP request to an url and return the response content.
|
String |
doPostMultiValues(String strUrl,
Map<String,List<String>> params,
fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator,
List<String> listElements,
Map<String,String> headersRequest,
Map<String,String> headersResponse)
Send a POST HTTP request to an url and return the response content.
|
String |
doPut(String strUrl,
fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator,
List<String> listElements,
Map<String,String> params,
Map<String,String> headersRequest,
Map<String,String> headersResponse)
Send a PUT HTTP request to an url and return the response content.
|
String |
doPutJSON(String strUrl,
String strJSON,
Map<String,String> headersRequest,
Map<String,String> headersResponse)
Do put json.
|
String |
doPutJSON(String strUrl,
String strJSON,
fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator,
List<String> listElements,
Map<String,String> headersRequest,
Map<String,String> headersResponse)
Do put json.
|
String |
doRequestEnclosingMethod(String strUrl,
String strMethod,
String strContent,
String contentType,
String charset,
fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator,
List<String> listElements,
Map<String,String> headersRequest,
Map<String,String> headersResponse)
Do request enclosing method.
|
org.apache.commons.fileupload.FileItem |
downloadFile(String strUrl)
Send a GET HTTP request to an Url and return the response content.
|
void |
downloadFile(String strUrl,
String strFilePath)
Send a GET HTTP request to an Url and return the response content.
|
String |
getFileName(String strUrl)
Send a GET HTTP request to an Url and return the response content.
|
public HttpAccess()
public HttpAccess(ResponseStatusValidator validator)
public String doGet(String strUrl) throws HttpAccessException
strUrl - The Url to accessHttpAccessException - if there is a problem to access to the given Urlpublic String doGet(String strUrl, fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator, List<String> listElements) throws HttpAccessException
strUrl - The Url to accessauthenticator - The RequestAuthenticatorlistElements - to include in the signatureHttpAccessException - if there is a problem to access to the given Urlpublic String doGet(String strUrl, fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator, List<String> listElements, Map<String,String> headers) throws HttpAccessException
strUrl - The Url to accessauthenticator - The RequestAuthenticatorlistElements - to include in the signatureheaders - the headersHttpAccessException - if there is a problem to access to the given Urlpublic String doGet(String strUrl, fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator, List<String> listElements, Map<String,String> headersRequest, Map<String,String> headersResponse) throws HttpAccessException
strUrl - The Url to accessauthenticator - The RequestAuthenticatorlistElements - to include in the signatureheadersRequest - Map of headers request parametersheadersResponse - Map to contain response headersHttpAccessException - if there is a problem to access to the given Urlpublic String doPost(String strUrl, Map<String,String> params) throws HttpAccessException
strUrl - the url to accessparams - the list of parameters to postHttpAccessException - if there is a problem to access to the given Urlpublic String doPost(String strUrl, Map<String,String> params, fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator, List<String> listElements) throws HttpAccessException
strUrl - the url to accessparams - the list of parameters to postauthenticator - The RequestAuthenticatorlistElements - to include in the signatureHttpAccessException - if there is a problem to access to the given Urlpublic String doPost(String strUrl, Map<String,String> params, fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator, List<String> listElements, Map<String,String> headersRequest) throws HttpAccessException
strUrl - the url to accessparams - the list of parameters to postauthenticator - The RequestAuthenticatorlistElements - to include in the signatureheadersRequest - Map of headers request parametersHttpAccessException - if there is a problem to access to the given Urlpublic String doPost(String strUrl, Map<String,String> params, fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator, List<String> listElements, Map<String,String> headersRequest, Map<String,String> headersResponse) throws HttpAccessException
strUrl - the url to accessparams - the list of parameters to postauthenticator - The RequestAuthenticatorlistElements - to include in the signatureheadersRequest - Map of headers request parametersheadersResponse - Map to contain response headersHttpAccessException - if there is a problem to access to the given Urlpublic String doRequestEnclosingMethod(String strUrl, String strMethod, String strContent, String contentType, String charset, fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator, List<String> listElements, Map<String,String> headersRequest, Map<String,String> headersResponse) throws HttpAccessException
strUrl - the str urlstrMethod - the str methodstrContent - the str contentcontentType - the content typecharset - the charsetauthenticator - the authenticatorlistElements - the list elementsheadersRequest - the headers requestheadersResponse - the headers responseHttpAccessException - the http access exceptionpublic String doPostJSON(String strUrl, String strJSON, fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator, List<String> listElements, Map<String,String> headersRequest, Map<String,String> headersResponse) throws HttpAccessException
strUrl - the str urlstrJSON - the str jsonauthenticator - the authenticatorlistElements - the list elementsheadersRequest - the headers requestheadersResponse - the headers responseHttpAccessException - the http access exceptionpublic String doPostJSON(String strUrl, String strJSON, Map<String,String> headersRequest, Map<String,String> headersResponse) throws HttpAccessException
strUrl - the str urlstrJSON - the str jsonheadersRequest - the headers requestheadersResponse - the headers responseHttpAccessException - the http access exceptionpublic String doPutJSON(String strUrl, String strJSON, fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator, List<String> listElements, Map<String,String> headersRequest, Map<String,String> headersResponse) throws HttpAccessException
strUrl - the str urlstrJSON - the str jsonauthenticator - the authenticatorlistElements - the list elementsheadersRequest - the headers requestheadersResponse - the headers responseHttpAccessException - the http access exceptionpublic String doPutJSON(String strUrl, String strJSON, Map<String,String> headersRequest, Map<String,String> headersResponse) throws HttpAccessException
strUrl - the str urlstrJSON - the str jsonheadersRequest - the headers requestheadersResponse - the headers responseHttpAccessException - the http access exceptionpublic String doPostMultiValues(String strUrl, Map<String,List<String>> params) throws HttpAccessException
strUrl - the url to accessparams - the list of parameters to postHttpAccessException - if there is a problem to access to the given Urlpublic String doPostMultiValues(String strUrl, Map<String,List<String>> params, fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator, List<String> listElements) throws HttpAccessException
strUrl - the url to accessparams - the list of parameters to postauthenticator - The RequestAuthenticatorlistElements - to include in the signatureHttpAccessException - if there is a problem to access to the given Urlpublic String doPostMultiValues(String strUrl, Map<String,List<String>> params, fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator, List<String> listElements, Map<String,String> headersRequest) throws HttpAccessException
strUrl - the url to accessparams - the list of parameters to postauthenticator - The RequestAuthenticatorlistElements - to include in the signatureheadersRequest - Map of headers request parametersHttpAccessException - if there is a problem to access to the given Urlpublic String doPostMultiValues(String strUrl, Map<String,List<String>> params, fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator, List<String> listElements, Map<String,String> headersRequest, Map<String,String> headersResponse) throws HttpAccessException
strUrl - the url to accessparams - the list of parameters to postauthenticator - The RequestAuthenticatorlistElements - to include in the signatureheadersRequest - Map of headers request parametersheadersResponse - Map to contain response headersHttpAccessException - if there is a problem to access to the given Urlpublic String doPostMultiPart(String strUrl, Map<String,List<String>> params, Map<String,org.apache.commons.fileupload.FileItem> fileItems) throws HttpAccessException
strUrl - the url to accessparams - the list of parameters to postfileItems - The list of file itemsHttpAccessException - if there is a problem to access to the given Urlpublic String doPostMultiPart(String strUrl, Map<String,List<String>> params, Map<String,org.apache.commons.fileupload.FileItem> fileItems, fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator, List<String> listElements) throws HttpAccessException
strUrl - the url to accessparams - the list of parameters to postfileItems - The list of file itemsauthenticator - The RequestAuthenticatorlistElements - to include in the signatureHttpAccessException - if there is a problem to access to the given Urlpublic String doPostMultiPart(String strUrl, Map<String,List<String>> params, Map<String,org.apache.commons.fileupload.FileItem> fileItems, fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator, List<String> listElements, Map<String,String> headersRequest) throws HttpAccessException
strUrl - the url to accessparams - the list of parameters to postfileItems - The list of file itemsauthenticator - The RequestAuthenticatorlistElements - to include in the signatureheadersRequest - Map of headers request parametersHttpAccessException - if there is a problem to access to the given Urlpublic String doPostMultiPart(String strUrl, Map<String,List<String>> params, Map<String,org.apache.commons.fileupload.FileItem> fileItems, fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator, List<String> listElements, Map<String,String> headersRequest, Map<String,String> headersResponse) throws HttpAccessException
strUrl - the url to accessparams - the list of parameters to postfileItems - The list of file itemsauthenticator - The RequestAuthenticatorlistElements - to include in the signatureheadersRequest - Map of headers request parametersheadersResponse - Map to contain response headersHttpAccessException - if there is a problem to access to the given Urlpublic String doPut(String strUrl, fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator, List<String> listElements, Map<String,String> params, Map<String,String> headersRequest, Map<String,String> headersResponse) throws HttpAccessException
strUrl - the url to accessauthenticator - The RequestAuthenticatorlistElements - to include in the signatureparams - the paramsheadersRequest - Map of headers request parametersheadersResponse - Map to contain response headersHttpAccessException - if there is a problem to access to the given Urlpublic String doDelete(String strUrl, fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator, List<String> listElements, Map<String,String> headersRequest, Map<String,String> headersResponse) throws HttpAccessException
strUrl - the url to accessauthenticator - The RequestAuthenticatorlistElements - to include in the signatureheadersRequest - Map of headers request parametersheadersResponse - Map to contain response headersHttpAccessException - if there is a problem to access to the given Urlpublic void downloadFile(String strUrl, String strFilePath) throws HttpAccessException
strUrl - The Url to accessstrFilePath - the file pathHttpAccessException - if there is a problem to access to the given Urlpublic String getFileName(String strUrl) throws HttpAccessException
strUrl - The Url to accessHttpAccessException - if there is a problem to access to the given Urlpublic org.apache.commons.fileupload.FileItem downloadFile(String strUrl) throws HttpAccessException
strUrl - The Url to accessFileItemHttpAccessException - if there is a problem to access to the given UrlCopyright © 2017 City of Paris. All rights reserved.