Package javax.ws.rs.core

Examples of javax.ws.rs.core.NewCookie


            while (it.hasNext())
            {
               Object next = it.next();
               if (next instanceof NewCookie)
               {
                  NewCookie cookie = (NewCookie) next;
                  response.addNewCookie(cookie);
                  it.remove();
               }
            }
            if (cookies.size() < 1)
View Full Code Here


      String value = "value_1";
      String path = "";
      String domain = "";
      int version = 1;

      NewCookie nck26 = javax.ws.rs.core.NewCookie.valueOf(NewCookie_toParse);

      pass = verifyNewCookie(nck26, name, value, path, domain, version,
              "", -1, false);
   }
View Full Code Here

      String value = "wile_e_coyote";
      String path = "/acme";
      String domain = "";
      int version = 1;

      NewCookie nck27 = javax.ws.rs.core.NewCookie.valueOf(NewCookie_toParse);

      pass = verifyNewCookie(nck27, name, value, path, domain, version,
              "", -1, false);
   }
View Full Code Here

   @Test
   public void testNewCookie3() throws Exception
   {
      try
      {
         NewCookie nck27 = javax.ws.rs.core.NewCookie.valueOf(null);
         throw new Exception("Expected IllegalArgumentException not thrown. Test Failed.");
      }
      catch (IllegalArgumentException ilex)
      {
View Full Code Here

      int maxage = javax.ws.rs.core.NewCookie.DEFAULT_MAX_AGE;
      int version = 1;
      boolean secure = false;

      Cookie ck1 = new Cookie(name, value);
      NewCookie nck1 = new NewCookie(ck1);

      name = "name_2";
      value = "value_2";
      String path = "/acme";
      String domain = "";

      Cookie ck2 = new Cookie(name, value, path, domain);
      NewCookie nck2 = new NewCookie(ck2);

      name = "name_3";
      value = "value_3";
      path = "";
      domain = "y.x.foo.com";

      Cookie ck3 = new Cookie(name, value, path, domain);
      NewCookie nck3 = new NewCookie(ck3);

      List<String> cookies = Arrays.asList(nck1.toString().toLowerCase(),
              nck2.toString().toLowerCase(),
              nck3.toString().toLowerCase());

      Response resp = Response.status(status).cookie(nck1, nck2, nck3).build();
      String tmp = verifyResponse(resp, null, status, null, null, null, null,
              null, cookies);
      if (tmp.endsWith("false"))
View Full Code Here

      List<String> lang = Arrays.asList("en_US", "en_GB", "zh_CN");

      String name = "name_1";
      String value = "value_1";
      Cookie ck1 = new Cookie(name, value);
      NewCookie nck1 = new NewCookie(ck1);

      List<String> cookies = Arrays.asList(nck1.toString().toLowerCase());

      Response resp = Response.status(status).header("Content-type",
              "text/plain").header("Content-type", "text/html").header("Content-Language", "en_US").
              header("Content-Language", "en_GB").header("Content-Language",
              "zh_CN").header("Cache-Control", "no-transform").
View Full Code Here

   {
      @Path("/set")
      @GET
      public Response set()
      {
         return Response.ok("content").cookie(new NewCookie("meaning", "42")).build();
      }
View Full Code Here

      String value = user.get().getSessionToken().toString();

      log.debug("Replacing session token with {}", value);

      return new NewCookie(
        SiteConfiguration.SESSION_TOKEN_NAME,
        value,   // Value
        "/",     // Path
        null,    // Domain
        null,    // Comment
        86400 * 30, // 30 days
        false);
    } else {
      // Remove the session token cookie
      log.debug("Removing session token");

      return new NewCookie(
        SiteConfiguration.SESSION_TOKEN_NAME,
        null,   // Value
        null,    // Path
        null,   // Domain
        null,   // Comment
View Full Code Here

  {
    String cookie = config.getAuthCookie();
    if (password != null && origin != null &&
  hash(password).equals(config.getPasswordHash())) {
      return Response.seeOther(URI.create(origin + "/beaker/"))
        .cookie(new NewCookie("BeakerAuth", cookie, "/", null, null,
                              NewCookie.DEFAULT_MAX_AGE, true)).build();
    }
    // bad password, try again
    return Response.seeOther(URI.create(origin + "/login/login.html")).build();
  }
View Full Code Here

        return buildNewCookie(modifiableCookie);

    }

    private NewCookie buildNewCookie(ModifiableCookie modifiableCookie) {
        NewCookie newCookie =
            new NewCookie(modifiableCookie.name, modifiableCookie.value, modifiableCookie.path,
                          modifiableCookie.domain, modifiableCookie.comment,
                          modifiableCookie.maxAge, modifiableCookie.secure);
        return newCookie;
    }
View Full Code Here

TOP

Related Classes of javax.ws.rs.core.NewCookie

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.