1
尝试从一个位置读取文档并写入其他位置。使用DocumentMetadataHandle来获取元数据和InputStreamHandle来读取内容。对于写时,我使用相同的InputStreamHandle,我用于读抛流封闭异常。当我在阅读中不使用DocumentMetadataHandle时,情况也是如此。编码如下。使用Java客户端API 3.0.7使用DocumentMetadataHandle和InputStreamHandle进行读取和写入
XMLDocumentManager documentManager = client.newXMLDocumentManager();
Transaction transaction = client.openTransaction();
InputStreamHandle handle = new InputStreamHandle();
DocumentMetadataHandle metadataHandle = new DocumentMetadataHandle();
documentManager.read(uri, metadataHandle, handle,transaction);
documentManager.write(newUri, metadataHandle, handle, transaction);
谢谢,Siju,我相信你找到了一个bug。 Erik的解决方案应该为您提供解决方法。然而,我已经在github上记录了这个,所以我们可以解决它:https://github.com/marklogic/java-client-api/issues/783 –
Erik's SOlution? –
ehennum的帖子,建议使用BytesHandle。 – kcoleman