@Test public void getsCookies() { headers.put(COOKIE, newArrayList("$Version=1;company=codenvy;$Path=/path,$Domain=codenvy.com", "name=andrew")); Map<String, Cookie> expectedCookies = ImmutableMap.of("company", new Cookie("company", "codenvy", "/path", "codenvy.com"), "name", new Cookie("name", "andrew")); assertEquals(expectedCookies, containerRequest.getCookies()); }
@Override public Map<String, Cookie> getCookies() { if (this.cookies == null) { Map<String, Cookie> cookies = new HashMap<>(); for (String cookieHeader : getCookieHeaders()) { List<Cookie> parsedCookies = HeaderHelper.parseCookies(cookieHeader); for (Cookie cookie : parsedCookies) { cookies.put(cookie.getName(), cookie); } } this.cookies = unmodifiableMap(cookies); } return cookies; }
ContainerRequest implements GenericContainerRequest { @Override public Map<String, Cookie> getCookies() { if (this.cookies == null) { Map<String, Cookie> cookies = new HashMap<>(); for (String cookieHeader : getCookieHeaders()) { List<Cookie> parsedCookies = HeaderHelper.parseCookies(cookieHeader); for (Cookie cookie : parsedCookies) { cookies.put(cookie.getName(), cookie); } } this.cookies = unmodifiableMap(cookies); } return cookies; } }
ContainerRequest implements GenericContainerRequest { @Override public Map<String, Cookie> getCookies() { if (this.cookies == null) { Map<String, Cookie> cookies = new HashMap<>(); for (String cookieHeader : getCookieHeaders()) { List<Cookie> parsedCookies = HeaderHelper.parseCookies(cookieHeader); for (Cookie cookie : parsedCookies) { cookies.put(cookie.getName(), cookie); } } this.cookies = unmodifiableMap(cookies); } return cookies; } ContainerRequest(String method, URI requestUri, URI baseUri, InputStream entityStream,
                            MultivaluedMap<String, String> httpHeaders, SecurityContext securityContext); }
ContainerRequest implements GenericContainerRequest { @Override public Map<String, Cookie> getCookies() { if (this.cookies == null) { Map<String, Cookie> cookies = new HashMap<>(); for (String cookieHeader : getCookieHeaders()) { List<Cookie> parsedCookies = HeaderHelper.parseCookies(cookieHeader); for (Cookie cookie : parsedCookies) { cookies.put(cookie.getName(), cookie); } } this.cookies = unmodifiableMap(cookies); } return cookies; } ContainerRequest(String method, URI requestUri, URI baseUri, InputStream entityStream,
                            MultivaluedMap<String, String> httpHeaders, SecurityContext securityContext); @Override MediaType getAcceptableMediaType(List<MediaType> mediaTypes); @Override List<String> getCookieHeaders(); @Override InputStream getEntityStream(); @Override URI getRequestUri(); @Override URI getBaseUri(); @Override String getMethod(); @Override void setMethod(String method); @Override void setEntityStream(InputStream entityStream); @Override void setUris(URI requestUri, URI baseUri); @Override void setCookieHeaders(List<String> cookieHeaders); @Override void setRequestHeaders(MultivaluedMap<String, String> httpHeaders); @Override String getAuthenticationScheme(); @Override Principal getUserPrincipal(); @Override boolean isSecure(); @Override boolean isUserInRole(String role); @Override ResponseBuilder evaluatePreconditions(EntityTag etag); @Override ResponseBuilder evaluatePreconditions(Date lastModified); @Override ResponseBuilder evaluatePreconditions(Date lastModified, EntityTag etag); @Override ResponseBuilder evaluatePreconditions(); @Override Variant selectVariant(List<Variant> variants); @Override List<Locale> getAcceptableLanguages(); @Override List<MediaType> getAcceptableMediaTypes(); @Override List<AcceptMediaType> getAcceptMediaTypeList(); @Override Map<String, Cookie> getCookies(); @Override Date getDate(); @Override int getLength(); @Override Locale getLanguage(); @Override MediaType getMediaType(); @Override List<String> getRequestHeader(String name); @Override String getHeaderString(String name); @Override MultivaluedMap<String, String> getRequestHeaders(); @Override String toString(); }
ContainerRequest implements GenericContainerRequest { @Override public Map<String, Cookie> getCookies() { if (this.cookies == null) { Map<String, Cookie> cookies = new HashMap<>(); for (String cookieHeader : getCookieHeaders()) { List<Cookie> parsedCookies = HeaderHelper.parseCookies(cookieHeader); for (Cookie cookie : parsedCookies) { cookies.put(cookie.getName(), cookie); } } this.cookies = unmodifiableMap(cookies); } return cookies; } ContainerRequest(String method, URI requestUri, URI baseUri, InputStream entityStream,
                            MultivaluedMap<String, String> httpHeaders, SecurityContext securityContext); @Override MediaType getAcceptableMediaType(List<MediaType> mediaTypes); @Override List<String> getCookieHeaders(); @Override InputStream getEntityStream(); @Override URI getRequestUri(); @Override URI getBaseUri(); @Override String getMethod(); @Override void setMethod(String method); @Override void setEntityStream(InputStream entityStream); @Override void setUris(URI requestUri, URI baseUri); @Override void setCookieHeaders(List<String> cookieHeaders); @Override void setRequestHeaders(MultivaluedMap<String, String> httpHeaders); @Override String getAuthenticationScheme(); @Override Principal getUserPrincipal(); @Override boolean isSecure(); @Override boolean isUserInRole(String role); @Override ResponseBuilder evaluatePreconditions(EntityTag etag); @Override ResponseBuilder evaluatePreconditions(Date lastModified); @Override ResponseBuilder evaluatePreconditions(Date lastModified, EntityTag etag); @Override ResponseBuilder evaluatePreconditions(); @Override Variant selectVariant(List<Variant> variants); @Override List<Locale> getAcceptableLanguages(); @Override List<MediaType> getAcceptableMediaTypes(); @Override List<AcceptMediaType> getAcceptMediaTypeList(); @Override Map<String, Cookie> getCookies(); @Override Date getDate(); @Override int getLength(); @Override Locale getLanguage(); @Override MediaType getMediaType(); @Override List<String> getRequestHeader(String name); @Override String getHeaderString(String name); @Override MultivaluedMap<String, String> getRequestHeaders(); @Override String toString();  }