fr.paris.lutece.util.httpaccess
Class HttpAccess

java.lang.Object
  extended by fr.paris.lutece.util.httpaccess.HttpAccess

public class HttpAccess
extends java.lang.Object

Http net Object Accessor


Constructor Summary
HttpAccess()
           
 
Method Summary
 java.lang.String doGet(java.lang.String strUrl)
          Send a GET HTTP request to an Url and return the response content.
 java.lang.String doGet(java.lang.String strUrl, fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator, java.util.List<java.lang.String> listElements)
          Send a GET HTTP request to an Url and return the response content.
 java.lang.String doPost(java.lang.String strUrl, java.util.Map<java.lang.String,java.lang.String> params)
          Send a POST HTTP request to an url and return the response content
 java.lang.String doPost(java.lang.String strUrl, java.util.Map<java.lang.String,java.lang.String> params, fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator, java.util.List<java.lang.String> listElements)
          Send a POST HTTP request to an url and return the response content
 java.lang.String doPostMultiPart(java.lang.String strUrl, java.util.Map<java.lang.String,java.util.List<java.lang.String>> params, java.util.Map<java.lang.String,org.apache.commons.fileupload.FileItem> fileItems)
          Send a POST HTTP request to an url and return the response content
 java.lang.String doPostMultiPart(java.lang.String strUrl, java.util.Map<java.lang.String,java.util.List<java.lang.String>> params, java.util.Map<java.lang.String,org.apache.commons.fileupload.FileItem> fileItems, fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator, java.util.List<java.lang.String> listElements)
          Send a POST HTTP request to an url and return the response content
 java.lang.String doPostMultiValues(java.lang.String strUrl, java.util.Map<java.lang.String,java.util.List<java.lang.String>> params)
          Send a POST HTTP request to an url and return the response content
 java.lang.String doPostMultiValues(java.lang.String strUrl, java.util.Map<java.lang.String,java.util.List<java.lang.String>> params, fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator, java.util.List<java.lang.String> listElements)
          Send a POST HTTP request to an url and return the response content
 void downloadFile(java.lang.String strUrl, java.lang.String strFilePath)
          Send a GET HTTP request to an Url and return the response content.
 java.lang.String getFileName(java.lang.String strUrl)
          Send a GET HTTP request to an Url and return the response content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpAccess

public HttpAccess()
Method Detail

doGet

public java.lang.String doGet(java.lang.String strUrl)
                       throws HttpAccessException
Send a GET HTTP request to an Url and return the response content.

Parameters:
strUrl - The Url to access
Returns:
The response content of the Get request to the given Url
Throws:
HttpAccessException - if there is a problem to access to the given Url

doGet

public java.lang.String doGet(java.lang.String strUrl,
                              fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator,
                              java.util.List<java.lang.String> listElements)
                       throws HttpAccessException
Send a GET HTTP request to an Url and return the response content.

Parameters:
strUrl - The Url to access
authenticator - The RequestAuthenticator
listElements - to include in the signature
Returns:
The response content of the Get request to the given Url
Throws:
HttpAccessException - if there is a problem to access to the given Url

doPost

public java.lang.String doPost(java.lang.String strUrl,
                               java.util.Map<java.lang.String,java.lang.String> params)
                        throws HttpAccessException
Send a POST HTTP request to an url and return the response content

Parameters:
strUrl - the url to access
params - the list of parameters to post
Returns:
The response content of the Post request to the given Url
Throws:
HttpAccessException - if there is a problem to access to the given Url

doPost

public java.lang.String doPost(java.lang.String strUrl,
                               java.util.Map<java.lang.String,java.lang.String> params,
                               fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator,
                               java.util.List<java.lang.String> listElements)
                        throws HttpAccessException
Send a POST HTTP request to an url and return the response content

Parameters:
strUrl - the url to access
params - the list of parameters to post
authenticator - The RequestAuthenticator
listElements - to include in the signature
Returns:
The response content of the Post request to the given Url
Throws:
HttpAccessException - if there is a problem to access to the given Url

doPostMultiValues

public java.lang.String doPostMultiValues(java.lang.String strUrl,
                                          java.util.Map<java.lang.String,java.util.List<java.lang.String>> params)
                                   throws HttpAccessException
Send a POST HTTP request to an url and return the response content

Parameters:
strUrl - the url to access
params - the list of parameters to post
Returns:
The response content of the Post request to the given Url
Throws:
HttpAccessException - if there is a problem to access to the given Url

doPostMultiValues

public java.lang.String doPostMultiValues(java.lang.String strUrl,
                                          java.util.Map<java.lang.String,java.util.List<java.lang.String>> params,
                                          fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator,
                                          java.util.List<java.lang.String> listElements)
                                   throws HttpAccessException
Send a POST HTTP request to an url and return the response content

Parameters:
strUrl - the url to access
params - the list of parameters to post
authenticator - The RequestAuthenticator
listElements - to include in the signature
Returns:
The response content of the Post request to the given Url
Throws:
HttpAccessException - if there is a problem to access to the given Url

doPostMultiPart

public java.lang.String doPostMultiPart(java.lang.String strUrl,
                                        java.util.Map<java.lang.String,java.util.List<java.lang.String>> params,
                                        java.util.Map<java.lang.String,org.apache.commons.fileupload.FileItem> fileItems)
                                 throws HttpAccessException
Send a POST HTTP request to an url and return the response content

Parameters:
strUrl - the url to access
params - the list of parameters to post
fileItems - The list of file items
Returns:
The response content of the Post request to the given Url
Throws:
HttpAccessException - if there is a problem to access to the given Url

doPostMultiPart

public java.lang.String doPostMultiPart(java.lang.String strUrl,
                                        java.util.Map<java.lang.String,java.util.List<java.lang.String>> params,
                                        java.util.Map<java.lang.String,org.apache.commons.fileupload.FileItem> fileItems,
                                        fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator,
                                        java.util.List<java.lang.String> listElements)
                                 throws HttpAccessException
Send a POST HTTP request to an url and return the response content

Parameters:
strUrl - the url to access
params - the list of parameters to post
fileItems - The list of file items
authenticator - The RequestAuthenticator
listElements - to include in the signature
Returns:
The response content of the Post request to the given Url
Throws:
HttpAccessException - if there is a problem to access to the given Url

downloadFile

public void downloadFile(java.lang.String strUrl,
                         java.lang.String strFilePath)
                  throws HttpAccessException
Send a GET HTTP request to an Url and return the response content.

Parameters:
strUrl - The Url to access
strFilePath - the file path
Throws:
HttpAccessException - if there is a problem to access to the given Url

getFileName

public java.lang.String getFileName(java.lang.String strUrl)
                             throws HttpAccessException
Send a GET HTTP request to an Url and return the response content.

Parameters:
strUrl - The Url to access
Returns:
the file name
Throws:
HttpAccessException - if there is a problem to access to the given Url


Copyright © 2011 Mairie de Paris. All Rights Reserved.