if (!name.startsWith("$")) { //$NON-NLS-1$
// this is the start of a new cookie
if (currentCookie != null) {
if (currentCookie.name != null && currentCookie.value != null) {
cookies.add(new Cookie(currentCookie.name, currentCookie.value,
currentCookie.path, currentCookie.domain,
currentCookie.version));
}
}
currentCookie = new ModifiableCookie();
currentCookie.name = name;
currentCookie.value = value;
currentCookie.version = version;
} else if (name.startsWith(VERSION)) {
version = Integer.parseInt(value);
} else if (name.startsWith(PATH) && currentCookie != null) {
currentCookie.path = value;
} else if (name.startsWith(DOMAIN) && currentCookie != null) {
currentCookie.domain = value;
}
}
if (currentCookie != null) {
if (currentCookie.name != null && currentCookie.value != null) {
cookies.add(new Cookie(currentCookie.name, currentCookie.value,
currentCookie.path, currentCookie.domain,
currentCookie.version));
}
}