Class VerifiyBackUrlUtils


  • public class VerifiyBackUrlUtils
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static org.springframework.util.PathMatcher PATH_MATCHER  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean compareBaseUrl​(java.lang.String url1, java.lang.String url2)
      Compare to base url
      static boolean containsNoUnauthorizedHTML​(java.lang.String strBackUrl)
      Test if the BacUrl is a valid url
      static boolean containsUnauthorizedCharactersDomain​(java.lang.String strBackUrl)
      Test if the BackUrl is a valid url
      static void dropBackUrlInSession​(javax.servlet.http.HttpServletRequest request, java.lang.String strSessionAttributeName)
      Drop Service in session
      static java.lang.String encodeUrl​(java.lang.String strUrl)
      encode url in base64
      static java.lang.String getBackUrlInSession​(javax.servlet.http.HttpServletRequest request, java.lang.String strSessionAttributeName)
      Return the back url in session
      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
      static boolean isValidBackUrl​(java.lang.String strBackUrl)
      Test if the BacUrl is a valid url
      static void storeBackUrlInSession​(javax.servlet.http.HttpServletRequest request, java.lang.String strBackUrl, java.lang.String strSessionAttributeName)
      Store service in session
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • PATH_MATCHER

        public static final org.springframework.util.PathMatcher PATH_MATCHER
    • Constructor Detail

      • VerifiyBackUrlUtils

        public VerifiyBackUrlUtils()
    • 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 HttpServletRequest
        strBackUrl - the backUrl to store in session
        strSessionAttributeName - 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 HttpServletrequest
        strSessionAttributeName - 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 backurl
        request - 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