/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2005 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: CookieUtils.java,v 1.3 2008/06/25 05:41:41 qcheng Exp $
*
*/
/**
* Implements utility methods for handling Cookie.
*
* @deprecated As of OpenSSO version 8.0
* {@link com.sun.identity.shared.encode.CookieUtils}
*/
public class CookieUtils {
/**
* Gets property value of "com.iplanet.am.cookie.name"
*
* @return the property value of "com.iplanet.am.cookie.name"
*/
return amCookieName;
}
/**
* Gets property value of "com.iplanet.am.pcookie.name"
*
* @return the property value of "com.iplanet.am.pcookie.name"
*/
return amPCookieName;
}
/**
* Gets property value of "com.iplanet.services.cdsso.cookiedomain"
*
* @return the property value of "com.iplanet.services.cdsso.cookiedomain"
*/
if (cookieDomains != null) {
return cookieDomains;
}
return Collections.EMPTY_SET;
}
while (st.hasMoreTokens()) {
}
}
if (cookieDomains.isEmpty()) {
return Collections.EMPTY_SET;
}
return cookieDomains;
}
/**
* Gets property value of "com.sun.identity.federation.fedCookieName"
*
* @return the property value of "com.sun.identity.federation.fedCookieName"
*/
return fedCookieName;
}
/**
* Gets property value of "com.iplanet.am.cookie.secure"
*
* @return the property value of "com.iplanet.am.cookie.secure"
*/
public static boolean isCookieSecure() {
return secureCookie;
}
/**
* Gets value of cookie that has mached name in servlet request
*
* @param req
* request
* @param name
* name in servlet request
* @return value of that name of cookie
*/
try {
return getCookieValue(cookie);
} else {
}
} catch (Exception e) {
}
return cookieValue;
}
/**
* Gets cookie object that has mached name in servlet request
*
* @param req
* request
* @param name
* name in servlet request
* @return value of that name of cookie
*/
}
}
}
return null;
}
/**
* Gets normalized value of cookie
*
* @param cookie
* cookie object
* @return value
*/
// Check property value and it decode value
// Bea, IBM
}
return cookieValue;
}
/**
* Gets Array of cookie in servlet request
*
* @param req
* request
*
*/
if (!cookieEncoding) {
return cookies;
}
.getValue());
if (cookieValue != null) {
}
}
}
return cookies;
}
/**
* Constructs a cookie with a specified name and value.
*
* @param name
* a String specifying the name of the cookie
*
* @param value
* a String specifying the value of the cookie
*
* @return constructed cookie
*/
}
/**
* Constructs a cookie with a specified name and value and sets the maximum
* age of the cookie in seconds.
*
* @param name
* a String specifying the name of the cookie
*
* @param value
* a String specifying the value of the cookie
*
* @param maxAge
* an integer specifying the maximum age of the cookie in
* seconds; if negative, means the cookie is not stored; if zero,
* deletes the cookie
*
* @return constructed cookie
*/
}
/**
* Constructs a cookie with a specified name and value and sets a path for
* the cookie to which the client should return the cookie.
*
* @param name
* a String specifying the name of the cookie
*
* @param value
* a String specifying the value of the cookie
*
* @param path
* a String specifying a path
*
* @return constructed cookie
*/
}
/**
* Constructs a cookie with a specified name and value and sets a path for
* the cookie to which the client should return the cookie and sets the
* domain within which this cookie should be presented.
*
* @param name
* a String specifying the name of the cookie
*
* @param value
* a String specifying the value of the cookie
*
* @param path
* a String specifying a path
*
* @param domain
* a String containing the domain name within which this cookie
* is visible; form is according to <code>RFC 2109</code>
*
* @return constructed cookie
*/
}
/**
* Constructs a cookie with a specified name and value and sets the maximum
* age of the cookie in seconds and sets a path for the cookie to which the
* client should return the cookie and sets the domain within which this
* cookie should be presented.
*
* @param name
* a String specifying the name of the cookie
*
* @param value
* a String specifying the value of the cookie
*
* @param maxAge
* an integer specifying the maximum age of the cookie in
* seconds; if negative, means the cookie is not stored; if zero,
* deletes the cookie
*
* @param path
* a String specifying a path
*
* @param domain
* a String containing the domain name within which this cookie
* is visible; form is according to RFC 2109
*
* @return constructed cookie
*/
// Based on property value it does url encoding.
// BEA, IBM
if (cookieEncoding) {
} else {
}
} else {
}
}
return cookie;
}
/**
* Check cookie value whether it has double quote or not. Remove start /
* ending double quote from cookie and returns cookie value only.
*
* @param cookie
* a String value of cookie
*
* @return cookie value without double quote
*/
}
return cookie;
}
}