Package com.everbox4j.bean

Examples of com.everbox4j.bean.FileEditTimeConflict


  public static void registerFileConflict(EverBoxObject ebo){
    log.infof("更新本地文件信息到数据库 %s", ebo.getPath());
    File f = new File(EverboxConfig.getRealPath(ebo));
    if(!f.exists())
      return;
    FileEditTimeConflict fetc = dao.fetch(FileEditTimeConflict.class, ebo.getPath());
    if(fetc != null) {
      fetc.setLastModify(ebo.getEditTime());
      fetc.setApiVerion(EverboxConfig.DB_API_VERSION);
      dao.update(fetc);
    } else {
      fetc = new FileEditTimeConflict();
      fetc.setPath(ebo.getPath());
      fetc.setLastModify(ebo.getEditTime());
      fetc.setApiVerion(EverboxConfig.DB_API_VERSION);
      dao.insert(fetc);
    }
    log.info("更新完成");
  }
View Full Code Here


  public static boolean checkFileConflict(EverBoxObject ebo) {
    log.infof("向数据库查询文件的伪冲突情况 %s", ebo.getPath());
    File f = new File(EverboxConfig.getRealPath(ebo));
    if(!f.exists())
      return true;
    FileEditTimeConflict fetc = dao.fetch(FileEditTimeConflict.class, ebo.getPath());
    if(fetc != null && fetc.getLastModify() == ebo.getEditTime()) {
//        System.out.println(fetc.getLastModify() +" " + ebo.getEditTime());
        return false;
    }
    log.infof("文件不存在伪冲突情况 %s", ebo.getPath());
    return true;
View Full Code Here

TOP

Related Classes of com.everbox4j.bean.FileEditTimeConflict

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.