hudson.plugins.findbugs.util
Class CookieHandler

java.lang.Object
  extended by hudson.plugins.findbugs.util.CookieHandler

public class CookieHandler
extends java.lang.Object

Creates and converts cookies.

Author:
Ulli Hafner

Constructor Summary
CookieHandler(java.lang.String name)
          Creates a new instance of CookieHandler.
 
Method Summary
 javax.servlet.http.Cookie create(java.util.List<org.kohsuke.stapler.Ancestor> requestAncestors, java.lang.String value)
          Sends a cookie with the specified value.
 java.lang.String getValue(javax.servlet.http.Cookie[] cookies)
          Selects the correct cookie from the specified cookies and returns its value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CookieHandler

public CookieHandler(java.lang.String name)
Creates a new instance of CookieHandler.

Parameters:
name - the name of the cookie
Method Detail

create

public javax.servlet.http.Cookie create(java.util.List<org.kohsuke.stapler.Ancestor> requestAncestors,
                                        java.lang.String value)
Sends a cookie with the specified value.

Parameters:
requestAncestors - the ancestors of the request
value - the cookie value
Returns:
the created cookie

getValue

public java.lang.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


Copyright © 2009. All Rights Reserved.