本文整理汇总了Java中com.mongodb.gridfs.GridFS.DEFAULT_BUCKET属性的典型用法代码示例。如果您正苦于以下问题:Java GridFS.DEFAULT_BUCKET属性的具体用法?Java GridFS.DEFAULT_BUCKET怎么用?Java GridFS.DEFAULT_BUCKET使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.mongodb.gridfs.GridFS
的用法示例。
在下文中一共展示了GridFS.DEFAULT_BUCKET属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initializeConnection
@SuppressWarnings("deprecation")
public void initializeConnection() throws Exception {
LOG.info("Initialize GridFS endpoint: {}", this.toString());
if (database == null) {
throw new IllegalStateException("Missing required endpoint configuration: database");
}
db = mongoConnection.getDB(database);
if (db == null) {
throw new IllegalStateException("Could not initialize GridFsComponent. Database " + database + " does not exist.");
}
gridFs = new GridFS(db, bucket == null ? GridFS.DEFAULT_BUCKET : bucket) {
{
filesCollection = getFilesCollection();
}
};
}
示例2: MongoGridFSSession
public MongoGridFSSession(IMongoDataSourceAdapter dataSourceAdapter) throws Exception {
this(dataSourceAdapter, GridFS.DEFAULT_BUCKET);
}
示例3: parseGridFSIdentifier
static GridFSIdentifier parseGridFSIdentifier(String container) {
String[] parts = container.split("/");
String dbName = parts[0];
String bucket = parts.length > 1 ? parts[1] : GridFS.DEFAULT_BUCKET;
return new GridFSIdentifier(dbName, bucket);
}