Package org.restlet.data

Examples of org.restlet.data.CookieSetting


     * @throws IOException
     */
    private void testCookieSetting(String headerValue, boolean compare)
            throws IOException {
        CookieSettingReader cr = new CookieSettingReader(headerValue);
        CookieSetting cookie = cr.readValue();

        // Rewrite the header
        String newHeaderValue = CookieSettingWriter.write(cookie);

        // Compare initial and new headers
View Full Code Here


    public static CookieSetting toRestletCookieSetting(NewCookie newCookie)
            throws IllegalArgumentException {
        if (newCookie == null) {
            return null;
        }
        return new CookieSetting(newCookie.getVersion(), newCookie.getName(),
                newCookie.getValue(), newCookie.getPath(), newCookie
                        .getDomain(), newCookie.getComment(), newCookie
                        .getMaxAge(), newCookie.isSecure());
    }
View Full Code Here

        super(delegate);
    }

    @Override
    public CookieSetting createEntry(String name, String value) {
        return new CookieSetting(name, value);
    }
View Full Code Here

      actor = new LoginActor() {
         public void authenticated(Form authForm,Identity identity)
         {
            String name = getCookieName();
            if (name!=null) {
               CookieSetting cookie = new CookieSetting("I",identity.getSession());
               cookie.setPath(getCookiePath());
               getResponse().getCookieSettings().add(cookie);
            }
            if (name!=null && idManager!=null) {
               idManager.add(identity.getSession(), identity);
            }
View Full Code Here

            String password = new String(authResponse.getSecret());
            LoginAction.LoginActor actor = new LoginAction.LoginActor() {
               public void authenticated(Form authForm,Identity identity) {
                  String name = getCookieName(request);
                  if (name!=null) {
                     CookieSetting cookie = new CookieSetting("I",identity.getSession());
                     cookie.setPath(getCookiePath(request));
                     response.getCookieSettings().add(cookie);
                  }
                  if (name!=null && idManager!=null) {
                     idManager.add(identity.getSession(), identity);
                  }
View Full Code Here

      Reference service = ActionResource.getReferenceAttribute(getRequest(),"auth-service",confService);
      String name = getCookieName();
      Cookie cookie = null;
      if (name!=null) {
         cookie = getRequest().getCookies().getFirst(name);
         CookieSetting unset = new CookieSetting(name,"");
         unset.setMaxAge(0);
         unset.setPath(getCookiePath());
         getResponse().getCookieSettings().add(unset);
      }
      getResponse().setStatus(Status.SUCCESS_NO_CONTENT);
      if (cookie!=null && service!=null) {
         Client client = new Client(getContext().createChildContext(),service.getSchemeProtocol());
View Full Code Here

      actor = new LoginActor() {
         public void authenticated(Form authForm,Identity identity)
         {
            String name = getCookieName();
            if (name!=null) {
               CookieSetting cookie = new CookieSetting("I",identity.getSession());
               cookie.setPath(getCookiePath());
               getResponse().getCookieSettings().add(cookie);
            }
            if (name!=null && idManager!=null) {
               idManager.add(identity.getSession(), identity);
            }
View Full Code Here

            name = reader.nextName();
            if (name.equals("session_name")) {
                session_name = reader.nextString();
            }
            reader.close();
            return new CookieSetting(0, session_name, session_id);
        } catch (IOException ex) {
            Logger.getLogger(JavaUploader.class.getName()).log(Level.SEVERE, null, ex);
        }
        return null;
    }
View Full Code Here

     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {


        CookieSetting cS = login("gpulido", "senioranillos");
        if (cS != null) {
            //postPlugin(cS);
            //putPlugin(cS,831);
            //postFile(cS);
        }
View Full Code Here

            name = reader.nextName();
            if (name.equals("session_name")) {
                session_name = reader.nextString();
            }
            reader.close();
            return new CookieSetting(0, session_name, session_id);
        } catch (IOException ex) {
            Logger.getLogger(RestTestClient.class.getName()).log(Level.SEVERE, null, ex);
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of org.restlet.data.CookieSetting

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.