public static void addFlash(Response response, String message, Kind kind) { dropboxes.put(nextdrop,new Flash(message, kind)); Series<CookieSetting> cookies = response.getCookieSettings(); CookieSetting flashdrop = null; for(CookieSetting cs : cookies) { if(cs.getName().equals("flashdrop")) { flashdrop = cs; } } if(flashdrop == null) { cookies.add(new CookieSetting("flashdrop",Long.toString(nextdrop))); } else { flashdrop.setValue(flashdrop.getValue()+","+Long.toString(nextdrop)); } nextdrop++; }
@Override public String getName() { return target.getName(); }
public static void addFlash(Response response, String message, Kind kind) { dropboxes.put(nextdrop,new Flash(message, kind)); Series<CookieSetting> cookies = response.getCookieSettings(); CookieSetting flashdrop = null; for(CookieSetting cs : cookies) { if(cs.getName().equals("flashdrop")) { flashdrop = cs; } } if(flashdrop == null) { cookies.add(new CookieSetting("flashdrop",Long.toString(nextdrop))); } else { flashdrop.setValue(flashdrop.getValue()+","+Long.toString(nextdrop)); } nextdrop++; }
@Override public String toString() { return "CookieSetting [accessRestricted=" + accessRestricted + ", comment=" + comment + ", maxAge=" + maxAge + ", secure=" + secure + ", domain=" + getDomain() + ", name=" + getName() + ", path=" + getPath() + ", value=" + getValue() + ", version=" + getVersion() + "]"; }
@Override public String toString() { return "CookieSetting [accessRestricted=" + accessRestricted + ", comment=" + comment + ", maxAge=" + maxAge + ", secure=" + secure + ", domain=" + getDomain() + ", name=" + getName() + ", path=" + getPath() + ", value=" + getValue() + ", version=" + getVersion() + "]"; }
/** * Converts the Restlet CookieSettings to a JAX-RS NewCookie. * * @param cookieSetting * @return the JAX-RS NewCookie * @throws IllegalArgumentException */ public static NewCookie toJaxRsNewCookie(CookieSetting cookieSetting) throws IllegalArgumentException { if (cookieSetting == null) { return null; } return new NewCookie(cookieSetting.getName(), cookieSetting.getValue(), cookieSetting.getPath(), cookieSetting.getDomain(), cookieSetting.getVersion(), cookieSetting.getComment(), cookieSetting.getMaxAge(), cookieSetting.isSecure()); }
/** * Converts the Restlet {@link CookieSetting} to a JAX-RS {@link NewCookie}. * * @param cookieSetting * The Restlet cookie setting. * @return The JAX-RS NewCookie * @throws IllegalArgumentException */ public static NewCookie toNewCookie(CookieSetting cookieSetting) throws IllegalArgumentException { if (cookieSetting == null) { return null; } return new NewCookie(cookieSetting.getName(), cookieSetting.getValue(), cookieSetting.getPath(), cookieSetting.getDomain(), cookieSetting.getVersion(), cookieSetting.getComment(), cookieSetting.getMaxAge(), cookieSetting.isSecure()); }
@Override public CookieSettingWriter append(CookieSetting cookieSetting) throws IllegalArgumentException { String name = cookieSetting.getName(); String value = cookieSetting.getValue(); int version = cookieSetting.getVersion();