use of org.apache.http.impl.cookie.BasicClientCookie in project spring-framework by spring-projects.
the class MockMvcWebConnection method createCookie.
private static com.gargoylesoftware.htmlunit.util.Cookie createCookie(jakarta.servlet.http.Cookie cookie) {
Date expires = null;
if (cookie.getMaxAge() > -1) {
expires = new Date(System.currentTimeMillis() + cookie.getMaxAge() * 1000);
}
BasicClientCookie result = new BasicClientCookie(cookie.getName(), cookie.getValue());
result.setDomain(cookie.getDomain());
result.setComment(cookie.getComment());
result.setExpiryDate(expires);
result.setPath(cookie.getPath());
result.setSecure(cookie.getSecure());
if (cookie.isHttpOnly()) {
result.setAttribute("httponly", "true");
}
return new com.gargoylesoftware.htmlunit.util.Cookie(result);
}
use of org.apache.http.impl.cookie.BasicClientCookie in project Libraries-for-Android-Developers by eoecn.
the class SerializableCookie method readObject.
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
String name = (String) in.readObject();
String value = (String) in.readObject();
clientCookie = new BasicClientCookie(name, value);
clientCookie.setComment((String) in.readObject());
clientCookie.setDomain((String) in.readObject());
clientCookie.setExpiryDate((Date) in.readObject());
clientCookie.setPath((String) in.readObject());
clientCookie.setVersion(in.readInt());
clientCookie.setSecure(in.readBoolean());
}
use of org.apache.http.impl.cookie.BasicClientCookie in project SmartAndroidSource by jaychou2012.
the class SerializableCookie method readObject.
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
String name = (String) in.readObject();
String value = (String) in.readObject();
clientCookie = new BasicClientCookie(name, value);
clientCookie.setComment((String) in.readObject());
clientCookie.setDomain((String) in.readObject());
clientCookie.setExpiryDate((Date) in.readObject());
clientCookie.setPath((String) in.readObject());
clientCookie.setVersion(in.readInt());
clientCookie.setSecure(in.readBoolean());
}
use of org.apache.http.impl.cookie.BasicClientCookie in project openkit-android by OpenKit.
the class SerializableCookie method readObject.
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
String name = (String) in.readObject();
String value = (String) in.readObject();
clientCookie = new BasicClientCookie(name, value);
clientCookie.setComment((String) in.readObject());
clientCookie.setDomain((String) in.readObject());
clientCookie.setExpiryDate((Date) in.readObject());
clientCookie.setPath((String) in.readObject());
clientCookie.setVersion(in.readInt());
clientCookie.setSecure(in.readBoolean());
}
use of org.apache.http.impl.cookie.BasicClientCookie in project undertow by undertow-io.
the class AbstractModClusterTestBase method checkGet.
static String checkGet(final String context, int statusCode, String route) throws IOException {
final HttpGet get = get(context);
if (route != null && getSessionRoute() == null) {
BasicClientCookie cookie = new BasicClientCookie("JSESSIONID", "randomSessionID." + route);
httpClient.getCookieStore().addCookie(cookie);
}
final HttpResponse result = httpClient.execute(get);
final String response = HttpClientUtils.readResponse(result);
Assert.assertEquals(statusCode, result.getStatusLine().getStatusCode());
if (route != null) {
Assert.assertEquals(route, getSessionRoute());
}
return response;
}
Aggregations