Class CookieConverter


  • public class CookieConverter
    extends Object
    Helper to extract cookies from cookies string.
    • Constructor Detail

      • CookieConverter

        public CookieConverter()
    • Method Detail

      • getCookies

        public static List<org.apache.http.cookie.Cookie> getCookies​(String[] cookiesStrings,
                                                                     URL targetURL)
        Get a list of cookies based on the cookies string taken from response header and the target url.
        Parameters:
        cookiesStrings - the value(s) of the http header for "Cookie" in the http response.
        targetURL - the url for which we wish to pass the cookies in the request.
        Returns:
        List off cookies to add to the request.
      • checkDomainMatchToUrl

        public static boolean checkDomainMatchToUrl​(String cookieDomain,
                                                    String urlHostName)
        Helper method to check if url matches a cookie domain.
        Parameters:
        cookieDomain - the domain in the cookie
        urlHostName - the host name of the url
        Returns:
        does the cookie match the host name