// 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)));
}
}
}