}
DB db = Configuration.getMongo().getDB(
Configuration.getProperty("mongo.db"));
V7GridFS fs = new V7GridFS(db);
String[] path = CopyCommand.getPath(args[1], args[2]);
V7File existing = fs.getFile(path);
if (existing != null) {
if (existing.hasContent()) {
throw new IOException(args[2]
+ " already exists (and is a file)");
}
throw new IOException("directory " + args[2] + " already exists");
}
V7File parent = CopyCommand.getParent(fs, path);
fs.addFolder(parent.getId(), path[path.length - 1]);
}