Package com.mongodb.gridfs

Examples of com.mongodb.gridfs.GridFSFile


    }

    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));
            }
        } else {
            object = MongoDBHelper.applyExcludeFields(object, excludeFields);
            object = MongoDBHelper.applyIncludeFields(object, includeFields);
        }
View Full Code Here


        return true;
    }

    private DBObject applyFieldFilter(DBObject object) {
        if (object instanceof GridFSFile) {
            GridFSFile file = (GridFSFile) object;
            DBObject metadata = file.getMetaData();
            if (metadata != null) {
                file.setMetaData(applyFieldFilter(metadata));
            }
        } else {
            object = MongoDBHelper.applyExcludeFields(object, definition.getExcludeFields());
            object = MongoDBHelper.applyIncludeFields(object, definition.getIncludeFields());
        }
View Full Code Here

        esClient.admin().indices().prepareUpdateSettings(name).setSettings(ImmutableMap.of("index.refresh_interval", value)).get();
    }

    private DBObject applyFieldFilter(DBObject object) {
        if (object instanceof GridFSFile) {
            GridFSFile file = (GridFSFile) object;
            DBObject metadata = file.getMetaData();
            if (metadata != null) {
                file.setMetaData(applyFieldFilter(metadata));
            }
        } else {
            object = MongoDBHelper.applyExcludeFields(object, definition.getExcludeFields());
            object = MongoDBHelper.applyIncludeFields(object, definition.getIncludeFields());
        }
View Full Code Here

  @Autowired
  GridFsOperations gridFsOperations;
 
  @Override
  public String put(File image) throws FileNotFoundException {
    GridFSFile file = gridFsOperations.store(new FileInputStream(image),
        image.getName());
    Object id = file.getId();
    return id.toString();
  }
View Full Code Here

TOP

Related Classes of com.mongodb.gridfs.GridFSFile

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.