Package com.everbox4j.bean

Examples of com.everbox4j.bean.EverboxOPT


      log.info("当前模式: 上传模式");
      for (EverboxModify ebm : context.localRemoteDiffList) {
        if(ebm.getMode() == EverboxModify.MISS || ebm.getMode() == EverboxModify.OLDER)
          if(EverboxConfig.matchUpload(ebm.getEverBoxObject())
              && EverboxContext.checkFileConflict(ebm.getEverBoxObject())) {
            EverboxOPT opt = new EverboxOPT();
            opt.setMode(EverboxOPT.ADD);
            opt.setEverBoxObject(ebm.getEverBoxObject());
            context.remoteOpts.add(opt);
          }
      }
    }else if(EverboxConfig.isDownloadEnable()) {
      log.info("当前模式: 下载");
      for (EverboxModify ebm : context.localRemoteDiffList) {
        if(ebm.getMode() == EverboxModify.ADD || ebm.getMode() == EverboxModify.NEWER)
          if(EverboxConfig.matchDownload(ebm.getEverBoxObject())) {
            EverboxOPT opt = new EverboxOPT();
            opt.setMode(EverboxOPT.ADD);
            opt.setEverBoxObject(ebm.getEverBoxObject());
            context.localOpts.add(opt);
          } else
            log.info("文件不符合过滤条件,自动跳过 "+ ebm.getEverBoxObject().getPath());
      }
    }
View Full Code Here


//    System.out.println("-------------------------------------------------------");
//    System.out.println(Json.toJson(context.localOpts));
//    System.out.println("-------------------------------------------------------");
//    System.exit(1);
    for (Iterator<EverboxOPT> it = context.remoteOpts.iterator(); it.hasNext();) {
      EverboxOPT opt = it.next();
      EverBoxObject ebo = opt.getEverBoxObject();
      if(opt.getMode() == EverboxOPT.ADD) {
        if(ebo.getType() == EverboxConfig.FILE) {
          EverboxAPI.upload(ebo);
        } else if(ebo.getType() == EverboxConfig.DIR) {
          EverboxAPI.mkidrRemote(ebo);
        }
      } else if(opt.getMode() == EverboxOPT.DELETE) {
        EverboxAPI.deleteRemote(ebo);
      }
    }
    for (Iterator<EverboxOPT> it = context.localOpts.iterator(); it.hasNext();) {
      EverboxOPT opt = it.next();
      EverBoxObject ebo = opt.getEverBoxObject();
      if(opt.getMode() == EverboxOPT.ADD) {
        if(ebo.getType() == EverboxConfig.FILE) {
          EverboxAPI.download(ebo);
        } else if(ebo.getType() == EverboxConfig.DIR) {
          Files.makeDir(new File(EverboxConfig.getRealPath(ebo)));
        }
      } else if(opt.getMode() == EverboxOPT.DELETE) {
        Files.deleteDir(new File(EverboxConfig.getRealPath(ebo)));
      }
    }
  }
View Full Code Here

TOP

Related Classes of com.everbox4j.bean.EverboxOPT

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.