Package com.everbox4j.bean

Examples of com.everbox4j.bean.EverboxLocalFileInfo


        log.info("虽然服务器上的文件的最后修改时间比本地文件新,但大小与一致,需要额外检查 "+ ebo.getPath());
        if(thumbnailInfo.has("fileSize")) {
          long fileSize = thumbnailInfo.getLong("fileSize");
          if(fileSize == localEbo.getFileSize()) {
            String[] keys = makeFileKeys(ebo);
            EverboxLocalFileInfo info = EverboxContext.dao.fetch(EverboxLocalFileInfo.class, ebo.getPath());
            if(info != null && info.getRemoteRev() != null && info.getSha1s() != null) {
              if(info.getRemoteRev().equals(thumbnailInfo.getString("ver")) && info.getSha1s().equals(Json.toJson(keys))) {
                log.info("本地文件与服务器文件一致,无需下载");
                return;
              }
            }
            File f = new File(EverboxConfig.getRealPath(ebo));
View Full Code Here


    }
  }
 
  protected static void saveLocalFileInfo2DB(File f,EverBoxObject ebo, String[] keys, String ver){
    //登记到数据库
    EverboxLocalFileInfo info = new EverboxLocalFileInfo();
    info.setLastModify(f.lastModified());
    info.setPath(ebo.getPath());
    info.setSha1s(Json.toJson(keys));
    info.setRemoteRev(ver);
    info.setType(EverboxConfig.FILE);
    EverboxContext.saveOrUpdate(info, "path");
  }
View Full Code Here

    }
    ebo.setEditTime(file.lastModified() * 10000);
  }
 
  public static boolean checkLocalFileModify(EverBoxObject ebo,String[] keys){
    EverboxLocalFileInfo x = EverboxContext.get(EverboxLocalFileInfo.class, "path", ebo.getPath());
    if(x != null && x.getSha1s() != null) {
      if(Json.toJson(keys).equals(x.getSha1s()))
        return true;//Not modify
    }
    return false;//Changed
  }
View Full Code Here

TOP

Related Classes of com.everbox4j.bean.EverboxLocalFileInfo

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.