Class VerifiyBackUrlUtils
- java.lang.Object
-
- fr.paris.lutece.plugins.verifybackurl.utils.VerifiyBackUrlUtils
-
public class VerifiyBackUrlUtils extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static org.springframework.util.PathMatcherPATH_MATCHER
-
Constructor Summary
Constructors Constructor Description VerifiyBackUrlUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancompareBaseUrl(java.lang.String url1, java.lang.String url2)Compare to base urlstatic booleancontainsNoUnauthorizedHTML(java.lang.String strBackUrl)Test if the BacUrl is a valid urlstatic booleancontainsUnauthorizedCharactersDomain(java.lang.String strBackUrl)Test if the BackUrl is a valid urlstatic voiddropBackUrlInSession(javax.servlet.http.HttpServletRequest request, java.lang.String strSessionAttributeName)Drop Service in sessionstatic java.lang.StringencodeUrl(java.lang.String strUrl)encode url in base64static java.lang.StringgetBackUrlInSession(javax.servlet.http.HttpServletRequest request, java.lang.String strSessionAttributeName)Return the back url in sessionstatic java.lang.StringgetBaseUrl(java.lang.String strUrl)Get base url for input Url : http://site.paris.mdp/webapp/jsp ==> site.paris.mdp/webappstatic booleanisValidBackUrl(java.lang.String strBackUrl)Test if the BacUrl is a valid urlstatic voidstoreBackUrlInSession(javax.servlet.http.HttpServletRequest request, java.lang.String strBackUrl, java.lang.String strSessionAttributeName)Store service in session
-
-
-
Method Detail
-
isValidBackUrl
public static boolean isValidBackUrl(java.lang.String strBackUrl)
Test if the BacUrl is a valid url- Parameters:
strBackUrl- the back url to test- Returns:
- Test if the BackUrl is a valid url
-
containsNoUnauthorizedHTML
public static boolean containsNoUnauthorizedHTML(java.lang.String strBackUrl)
Test if the BacUrl is a valid url- Parameters:
strBackUrl- the back url to test- Returns:
- Test if the BackUrl is a valid url
-
containsUnauthorizedCharactersDomain
public static boolean containsUnauthorizedCharactersDomain(java.lang.String strBackUrl)
Test if the BackUrl is a valid url- Parameters:
strBackUrl- the back url to test- Returns:
- Test if the BackUrl is a valid url
-
compareBaseUrl
public static boolean compareBaseUrl(java.lang.String url1, java.lang.String url2)Compare to base url- Parameters:
url1-url2-- Returns:
- a boolean if base url of the two input Strings are the same an no empty.
-
getBaseUrl
public static java.lang.String getBaseUrl(java.lang.String strUrl)
Get base url for input Url : http://site.paris.mdp/webapp/jsp ==> site.paris.mdp/webapp- Parameters:
strUrl-- Returns:
- the base Url
-
storeBackUrlInSession
public static void storeBackUrlInSession(javax.servlet.http.HttpServletRequest request, java.lang.String strBackUrl, java.lang.String strSessionAttributeName)Store service in session- Parameters:
request- the HttpServletRequeststrBackUrl- the backUrl to store in sessionstrSessionAttributeName- the strSessionAttributeName who must store the backurl
-
dropBackUrlInSession
public static void dropBackUrlInSession(javax.servlet.http.HttpServletRequest request, java.lang.String strSessionAttributeName)Drop Service in session- Parameters:
request- the HttpServletrequeststrSessionAttributeName- the strSessionAttributeName who must store the backurl
-
getBackUrlInSession
public static java.lang.String getBackUrlInSession(javax.servlet.http.HttpServletRequest request, java.lang.String strSessionAttributeName)Return the back url in session- Parameters:
strSessionAttributeName- the strSessionAttributeName who must store the backurlrequest- the HttpServletRequest
-
encodeUrl
public static java.lang.String encodeUrl(java.lang.String strUrl)
encode url in base64- Parameters:
strUrl- the url to encode- Returns:
- an url encode in base64
-
-