} catch (FileNotFoundException e) {
System.out.println("Can't open file");
System.exit(1);
}
GridFSInputFile video = videos.createFile(inputStream, "video.mp4");
// create some meta data for the object
BasicDBObject meta = new BasicDBObject("description", "Jennifer Singing");
ArrayList<String> tags = new ArrayList<String>();
tags.add("Singing");
tags.add("Opera");
meta.append("tags", tags);
video.setMetaData(meta);
video.save();
System.out.println("Object ID in Files Collection: " + video.get("_id"));
System.out.println("Saved the file to MongoDB");
System.out.println("Now lets read it back out");