/** * If not set explicitly, the base URL is the configured default application * root path {@see RestClient}. * * @return the base URL used to contact the remote service */ public String getBaseUrl() { if (baseUrl != null) { return baseUrl; } else { return RestClient.getApplicationRoot(); } }
/** * Set a cookie for the domain and path returned by * {@link #getApplicationRoot()}. * * @param cookieName * The name of the cookie to set. * @param cookieValue * The value of the cookie to set. */ public static void setCookie(final String cookieName, final String cookieValue) { final AnchorElement anchorElement = Document.get().createAnchorElement(); anchorElement.setHref(RestClient.getApplicationRoot()); final String path = anchorElement.getPropertyString("pathname"); final String domain = anchorElement.getPropertyString("domain"); Cookies.setCookie(cookieName, cookieValue, null, domain, path, false); } }