Package com.mongodb.gridfs

Examples of com.mongodb.gridfs.GridFSInputFile.validate()


      gridFile.put("uniqueId", UidGenerator.generateUid());


      gridFile.setFilename(renameTo);
      gridFile.save(chunkSize);
      gridFile.validate();
    }
    catch(IOException e)
    {
      throw new DBException("Failed to read input file: "
          +file.getAbsolutePath(), e);
View Full Code Here


            GridFSInputFile in = gridFS.createFile(content);
            in.setFilename("lorem-" + i + ".pdf");
            in.setContentType("application/pdf");
            in.save();
            in.validate();

            String id = in.getId().toString();
            logger.debug("GridFS in: {}", in);
            logger.debug("Document created with id: {}", id);
            GridFSDBFile out = gridFS.findOne(in.getFilename());
View Full Code Here

            GridFS gridFS = new GridFS(mongoDB);
            GridFSInputFile in = gridFS.createFile(content);
            in.setFilename("test-attachment.html");
            in.setContentType("text/html");
            in.save();
            in.validate();

            String id = in.getId().toString();
            logger.debug("GridFS in: {}", in);
            logger.debug("Document created with id: {}", id);
View Full Code Here

            in = gridFS.createFile(content);
            in.setFilename("test-attachment-2.html");
            in.setContentType("text/html");
            in.save();
            in.validate();

            id = in.getId().toString();

            out = gridFS.findOne(in.getFilename());
            logger.debug("GridFS from findOne: {}", out);
View Full Code Here

            GridFS gridFS = new GridFS(mongoDB, getCollection());
            GridFSInputFile in = gridFS.createFile(content);
            in.setFilename("test-attachment.html");
            in.setContentType("text/html");
            in.save();
            in.validate();

            String id = in.getId().toString();
            logger.debug("GridFS in: {}", in);
            logger.debug("Document created with id: {}", id);
View Full Code Here

            GridFS gridFS = new GridFS(mongoDB);
            GridFSInputFile in = gridFS.createFile(content);
            in.setFilename("test-attachment.html");
            in.setContentType("text/html");
            in.save();
            in.validate();

            String id = in.getId().toString();
            logger.debug("GridFS in: {}", in);
            logger.debug("Document created with id: {}", id);
View Full Code Here

            GridFS gridFS = new GridFS(mongoDB);
            GridFSInputFile in = gridFS.createFile(content);
            in.setFilename("lorem.pdf");
            in.setContentType("application/pdf");
            in.save();
            in.validate();

            String id = in.getId().toString();
            logger.debug("GridFS in: {}", in);
            logger.debug("Document created with id: {}", id);
View Full Code Here

            BasicDBObject metadata = new BasicDBObject();
            metadata.put("attribut1", "value1");
            metadata.put("attribut2", "value2");
            in.put("metadata", metadata);
            in.save();
            in.validate();

            String id = in.getId().toString();
            logger.debug("GridFS in: {}", in);
            logger.debug("Document created with id: {}", id);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.