Examples of InnerToken


Examples of com.snda.everbox.sdk.auth.InnerToken

        return;
      File file = new File("everbox.data");
      if(file.exists()) {
        log.info("找到以前的登录验证数据,尝试快速登录");
        BufferedReader br = new BufferedReader(new FileReader(file));
        InnerToken it = new InnerToken(br.readLine(), br.readLine());
        Auth.setAccessToken(it);
        if(ping()) {
          log.info("登录成功,可以使用之前的登录验证数据");
          return;
        }
      }
      log.info("开始常规登录");
      int rc = Account.login(EverboxConfig.getUserName(), EverboxConfig.getPassword());
      if(rc != 200) {
        log.info("常规登录失败!!! 请检查用户名和密码!!");
        throw new RuntimeException("登录失败");
      }
      InnerToken it = Auth.getAccessToken();
      FileWriter fw = new FileWriter(file);
      fw.write(it.getToken());
      fw.write("\n");
      fw.write(it.getSecret());
      fw.flush();
      fw.close();
      log.info("记录本次登录验证信息,用于以后的快速登录");
    } catch (Throwable e) {
      throw new RuntimeException(e);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.