Example usage for com.mongodb.gridfs GridFS GridFS

List of usage examples for com.mongodb.gridfs GridFS GridFS

Introduction

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

Prototype

public GridFS(final DB db, final String bucket) 

Source Link

Document

Creates a GridFS instance for the specified bucket in the given database.

Usage

From source file:tango.mongo.MongoConnector.java

License:Open Source License

public boolean setProject(String name) {
    String dbname = getProjectDBName(name);
    if (dbname == null) {
        return false;
    }/* w  w  w . j a  va2  s  . c  om*/
    project = m.getDB(dbname);
    experiment = project.getCollection("experiment");
    structureMeasurement = project.getCollection("structureMeasurement");
    nucleus = project.getCollection("nucleus");
    object3D = project.getCollection("object3d");
    field = project.getCollection("field");
    selection = project.getCollection("selection");
    selection.setObjectClass(Selection.class);
    gfsField = new GridFS(project, "field");
    gfsNucleus = new GridFS(project, "nucleus");
    gfsFieldThumbnail = new GridFS(project, "fieldThumbnail");
    gfsNucleusThumbnail = new GridFS(project, "nucleusThumbnail");
    if (Core.GUIMode) {
        IJ.log("project: " + name + " (" + project.getName() + ") set!");
    }
    this.projectName = name;
    return true;
}