@SuppressWarnings("deprecation") // We know GridFS uses the old API. A new API version will be address later. private static GridFS getGridFS() throws Exception { if (gridFS == null) { gridFS = new GridFS(getMongo().getDB(db)); } return gridFS; }
throw new NullPointerException(MongoDBRiver.MONGODB_ID_FIELD); GridFS grid = new GridFS(mongoShardClient.getDB(definition.getMongoDb()), collection); GridFSDBFile file = grid.findOne(new ObjectId(objectId)); if (file != null) {
GridFS grid = new GridFS(mongoClient.getDB(definition.getMongoDb()), definition.getMongoCollection());
/** * Constructs a new {@code BlobStoreMongoGridFS} * * @param db The DB. */ public MongoGridFSBlobStore(DB db) { commandExecutor = new DefaultCommandExecutor(); gridFS = new GridFS(db); }
@Required public void setJongo(final Jongo jongo) { this.jongo = jongo; this.gridfs = new GridFS(jongo.getDatabase()); }
@PostConstruct private void postConstruct() { gridFS = new GridFS(mongoTemplate.getDb()); }
@PostConstruct private void postConstruct() { gridFS = new GridFS(mongoTemplate.getDb()); }
public MongoPipelineReader(DB db) { stages = db.getCollection(STAGES_COLLECTION); pipelinefs = new GridFS(db, PIPELINE_FS); }
@Inject public MongoGridFsFileContentDao(Mongo mongo, DatastoreConfig datastoreConfig) { String dbName = (String) datastoreConfig.properties().get("dbName"); if (dbName == null || dbName.isEmpty()) { dbName = "streamflow"; } DB db = mongo.getDB(dbName); gridFs = new GridFS(db); }
@SuppressWarnings("deprecation") // We know GridFS uses the old API. A new API version will be address later. private static GridFS getGridFS() throws Exception { if (gridFS == null) { gridFS = new GridFS(getMongo().getDB(db)); } return gridFS; }
private GridFS getGridFS() { if (null == gridFS) { DBCollection rootCollection = MongoConfigUtil.getCollection(inputURI); gridFS = new GridFS( rootCollection.getDB(), rootCollection.getName()); } return gridFS; }
@Override public Object supply(Brewery brewery) { MongoConfiguration mongoConfiguration = brewery.get(MongoConfiguration.class); MongoClient mongoClient = brewery.get(MongoClient.class); String filedatabaseName = mongoConfiguration.getFileDatabaseName(); DB db = mongoClient.getDB(filedatabaseName); return new GridFS(db); }
@Override public Object supply(Brewery brewery) { MongoConfiguration mongoConfiguration = brewery.get(MongoConfiguration.class); MongoClient mongoClient = brewery.get(MongoClient.class); String filedatabaseName = mongoConfiguration.getFileDatabaseName(); DB db = mongoClient.getDB(filedatabaseName); return new GridFS(db); }
private GridFS getGridFS(DBKey dbKey) { final String dbName = MongoDBClient.getDbName(dbKey.getCompany(), dbKey.getProject()); return new GridFS(client.getDB(dbName, true), ARTIFACTS_COLLECTION_NAME); } }
private GridFS getGridFS(DBKey dbKey) { final String dbName = MongoDBClient.getDbName(dbKey.getCompany(), dbKey.getProject()); return new GridFS(client.getDB(dbName, true), ARTIFACTS_COLLECTION_NAME); } }
public BuguFS(String connectionName, String bucket, int chunkSize){ this.bucket = bucket; this.chunkSize = chunkSize; DB db = BuguFramework.getInstance().getConnection(connectionName).getDB(); fs = new GridFS(db, bucket); files = db.getCollection(bucket + ".files"); //ensure the DBCursor can be cast to GridFSDBFile files.setObjectClass(GridFSDBFile.class); }
@Override public StorageMetadata getStorageMetadata(BucketPath bucketPath) { SPECIAL_LOGGER.debug("readmetadata " + bucketPath); // Dies LogZeile ist fuer den JUNIT-Tests StorageMetaDataTest LOGGER.debug("readmetadata " + bucketPath); GridFSBucket bucket = getGridFSBucket(bucketPath); checkBucketExists(bucket); GridFS gridFS = new GridFS(databaseDeprecated, bucketPath.getObjectHandle().getContainer()); GridFSDBFile one = gridFS.findOne(bucketPath.getObjectHandle().getName()); String jsonString = (String) one.getMetaData().get(STORAGE_METADATA_KEY); return gsonHelper.fromJson(jsonString); }
public MongoGridFSSession(IMongoDataSourceAdapter dataSourceAdapter, String bucketName) throws Exception { this.__id = UUIDUtils.UUID(); this.__dataSourceHolder = dataSourceAdapter; this.__bucketName = StringUtils.defaultIfBlank(bucketName, GridFS.DEFAULT_BUCKET); // __gridFS = new GridFS(new DB(dataSourceAdapter.getMongoClient(), dataSourceAdapter.getDataSourceCfgMeta().getDatabaseName()), __bucketName); __dbCollection = __gridFS.getDB().getCollection(__bucketName.concat(".files")); }