Package com.mongodb.gridfs

Examples of com.mongodb.gridfs.GridFS


     *
     * @param db The DB.
     */
    public MongoGridFSBlobStore(DB db) {
        commandExecutor = new DefaultCommandExecutor();
        gridFS = new GridFS(db);
    }
View Full Code Here


  private GridFS attachmentGrid;

  private GridFS getAttachmentGrid() {
    if (attachmentGrid == null) {
      attachmentGrid = new GridFS(database, "attachments");
    }

    return attachmentGrid;
  }
View Full Code Here

     *
     * @param db The DB.
     */
    public MongoGridFSBlobStore(DB db) {
        commandExecutor = new DefaultCommandExecutor();
        gridFS = new GridFS(db);
    }
View Full Code Here

            .map(MongoDBChangeSet.class)
            .map(MongoDBChangeSetEntry.class)
            .map(MongoDBFile.class);

        ds = morphia.createDatastore(connection, "rhqtest");
        gridFS = new GridFS(connection.getDB("rhqtest"));

        dataDir = new File("target", getClass().getSimpleName());
        if (dataDir.exists()) {
            purge(dataDir, false);
        }
View Full Code Here

    private GridFS gridFS;

    public FileDAO(DB db) {
        this.db = db;
        gridFS = new GridFS(this.db);
    }
View Full Code Here

     *
     * @param db The DB.
     */
    public MongoGridFSBlobStore(DB db) {
        commandExecutor = new DefaultCommandExecutor();
        gridFS = new GridFS(db);
    }
View Full Code Here

   
    response.setHeader("Content-disposition", "attachment;filename="
        + new String(fileName.getBytes(), "iso8859-1"));

    OutputStream os = response.getOutputStream();
    GridFS gridFs = new GridFS(mongoTemplate.getDb(), folder);
    GridFSDBFile gridFSDBFile = gridFs.findOne(fileName);

    FileCopyUtils.copy(gridFSDBFile.getInputStream(), os);
   
    os.flush();
    os.close();
View Full Code Here

        // File dest = new File(realPath + "/upload/dest/"
        // + originalFilename);
        //
        // file.transferTo(dest);

        GridFS gridFs = new GridFS(mongoTemplate.getDb(), folder);
        GridFSInputFile gfsFile = gridFs.createFile(file.getFileItem()
            .getInputStream());

        gfsFile.setFilename(originalFilename);
        gfsFile.save();
View Full Code Here

        cneMaps = db.getCollection(CNEMAPS_COLLECTION);
        cneMaps.ensureIndex(
                new BasicDBObject(ID_FIELD, 1),
                new BasicDBObject("unique", true));

        fs = new GridFS(db);
    }
View Full Code Here

            return;
        }

        // Optional bucket, default is "fs"
        String bucket = jsonObject.getString("bucket", GridFS.DEFAULT_BUCKET);
        GridFS files = new GridFS(db, bucket);

        GridFSDBFile file = files.findOne(objectId);
        if (file == null) {
            sendError(message, "File does not exist: " + objectId.toString());
            return;
        }
View Full Code Here

TOP

Related Classes of com.mongodb.gridfs.GridFS

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.