Class CookieHandler
- java.lang.Object
-
- hudson.plugins.performance.cookie.CookieHandler
-
public class CookieHandler extends Object
Creates and converts cookies.- Author:
- Ulli Hafner
-
-
Constructor Summary
Constructors Constructor Description CookieHandler(String name)
Creates a new instance ofCookieHandler
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.servlet.http.Cookie
create(List<org.kohsuke.stapler.Ancestor> requestAncestors, String value)
Sends a cookie with the specified value.String
getValue(javax.servlet.http.Cookie[] cookies)
Selects the correct cookie from the specified cookies and returns its value.
-
-
-
Constructor Detail
-
CookieHandler
public CookieHandler(String name)
Creates a new instance ofCookieHandler
.- Parameters:
name
- the name of the cookie
-
-
Method Detail
-
create
public javax.servlet.http.Cookie create(List<org.kohsuke.stapler.Ancestor> requestAncestors, String value)
Sends a cookie with the specified value.- Parameters:
requestAncestors
- the ancestors of the requestvalue
- the cookie value- Returns:
- the created cookie
-
getValue
public String getValue(javax.servlet.http.Cookie[] cookies)
Selects the correct cookie from the specified cookies and returns its value. If there is no such cookie, then an empty string is returned.- Parameters:
cookies
- the cookies to scan- Returns:
- the cookie value or an empty string if the cookie is not found
-
-