GridFSClient.java 文件源码

java
阅读 33 收藏 0 点赞 0 评论 0

项目:whatsmars 作者:
private String isExistedImage(BundleEntry entry) {
    GridFS gridFS = getInstance();
    DBObject query = new BasicDBObject();
    query.put("crc",entry.crc);
    query.put("md5_source",entry.md5);
    GridFSDBFile _current = gridFS.findOne(query);
    //根据MD5值查询,检测是否存在
    if(_current == null) {
        return null;
    }
    String format = (String)_current.get("format");
    if(format.startsWith(".")) {
        return _current.getFilename() + format;
    }
    return _current.getFilename() + "." + format;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号