Package v7db.files.mongodb

Examples of v7db.files.mongodb.V7GridFS.addFolder()


    }
  }

  public void testExisting() throws IOException {
    V7GridFS fs = new V7GridFS(getMongo().getDB("test"));
    fs.addFolder("x", "123");
    try {
      MkdirCommand.main(new String[] { "mkdir", "x", "123" });
      fail("should have croaked on existing directory");
    } catch (IOException e) {
View Full Code Here


  }

  public void testCopyFile() throws IOException {
    V7GridFS fs = new V7GridFS(getMongo().getDB("test"));
    ObjectId dir = fs.addFolder("test", "folder");
    fs.addFile("test".getBytes(), dir, "test.txt", "text/plain");

    CopyCommand.main(new String[] { "copy", "test", "folder/test.txt", "x",
        "copy.txt" });
View Full Code Here

    assertEquals("text/plain", file.getContentType());
  }

  public void testCopyDirectory() throws IOException {
    V7GridFS fs = new V7GridFS(getMongo().getDB("test"));
    ObjectId dir = fs.addFolder("test", "folder");
    fs.addFile("test".getBytes(), dir, "test.txt", "text/plain");

    CopyCommand
        .main(new String[] { "copy", "test", "folder", "x", "copy" });
View Full Code Here

      }
      throw new IOException("directory " + args[2] + " already exists");
    }

    V7File parent = CopyCommand.getParent(fs, path);
    fs.addFolder(parent.getId(), path[path.length - 1]);

  }

}
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.