228.6.4. create

在 GridFs 数据库中创建新文件。它使用 name 的传入标题中的 Exchange.FILE_NAME,以及正文内容(作为 InputStream)作为内容。

// from("direct:create").to("mongodb-gridfs?database=tickets&operation=create");
Map<String, Object> headers = new HashMap<String, Object>();
headers.put(Exchange.FILE_NAME, "filename.txt");
InputStream stream = ... the data for the file ...
template.requestBodyAndHeaders("direct:create", stream, headers);