Package com.knowgate.dfs

Examples of com.knowgate.dfs.HttpRequest


    sUsrPwd = sUserPassword;
  }

  public void run() {
    FileSystem oFs = new FileSystem();
    HttpRequest oReq;
   
    try {
      AtrilSession oSes = DAO.getAdminSession("AsyncAccountCache");
      User oUsr = new User(oSes, User.forUuid(sUsrNick));
      oSes.disconnect();
      oSes.close();

      oReq = new HttpRequest(sBaseUrl+"login.jsp", null, "post",
                   new NameValuePair[]{new NameValuePair("email", oUsr.getEmail()),
                                   new NameValuePair("passw", sUsrPwd),
                                   new NameValuePair("format", "session")});
      oReq.post();
      ArrayList<NameValuePair> aCookies = oReq.getCookies();

      NameValuePair[] aCachedPages = new NameValuePair[] {
        new NameValuePair("acctaxpayers", "ListTaxPayers.action"),
        new NameValuePair("accsuppliers", "ListClients.action"),
        new NameValuePair("accusers", "ListUsers.action")
      };
     
      for (int p=0; p<aCachedPages.length; p++) {
        oReq = new HttpRequest(sBaseUrl+aCachedPages[p].getValue());
        oReq.setCookies(aCookies);
        oReq.get();
        String sDyna = oReq.src();

        oReq = new HttpRequest(sBaseUrl+"cacheread.jsp?key="+sAccId+aCachedPages[p].getName());
        oReq.setCookies(aCookies);
        oReq.get();     
        String sCach = oReq.src();
       
        if (!sDyna.equals(sCach)) {
          oReq = new HttpRequest(sBaseUrl+"cachestore.jsp", null, "post",
          new NameValuePair[]{new NameValuePair("key", sAccId+aCachedPages[p].getName()), new NameValuePair("val", sDyna)});
          oReq.setCookies(aCookies);
          oReq.start();
        }   
      } // next

    } catch (Exception xcpt) {
      Log.out.error("AsyncAccountCache.run() "+xcpt.getClass().getName()+" "+xcpt.getMessage());
View Full Code Here

TOP

Related Classes of com.knowgate.dfs.HttpRequest

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.