Example usage for com.mongodb.gridfs GridFSFile getMetaData

List of usage examples for com.mongodb.gridfs GridFSFile getMetaData

Introduction

In this page you can find the example usage for com.mongodb.gridfs GridFSFile getMetaData.

Prototype

public DBObject getMetaData() 

Source Link

Document

Gets the file metadata.

Usage

From source file:org.elasticsearch.river.mongodb.util.MongoDBHelper.java

License:Apache License

public static DBObject applyFieldFilter(DBObject object, final Set<String> includeFields,
        final Set<String> excludeFields) {
    if (object instanceof GridFSFile) {
        GridFSFile file = (GridFSFile) object;
        DBObject metadata = file.getMetaData();
        if (metadata != null) {
            file.setMetaData(applyFieldFilter(metadata, includeFields, excludeFields));
        }//from w  w  w.  j a v a 2  s.  c  o m
    } else {
        object = MongoDBHelper.applyExcludeFields(object, excludeFields);
        object = MongoDBHelper.applyIncludeFields(object, includeFields);
    }
    return object;
}

From source file:piecework.content.concrete.GridFsContentResource.java

License:Educational Community License

public GridFsContentResource(GridFsOperations gridFsOperations, GridFSFile file, String location,
        Date uploadDate, List<Version> versions) {
    this.gridFsOperations = gridFsOperations;
    this.file = file;
    this.location = location;
    this.uploadDate = uploadDate;
    this.metadata = file.getMetaData();
    this.versions = versions;
}