我的 SharePoint 2013 版本是 15.0.4569.1506。我无法通过下面的 CMIS 代码在 SharePoint 中上传大于 37 MB 的文档。但直接进入 SharePoint 我可以这样做。我也尝试增加我的堆大小/缓存限制。我得到一个异常 - 'CmisRuntimeException:找到'
Folder someFolder = (Folder) session.getObjectByPath("/TestFolder");
File file = new File("C:/Users/Administrator/Desktop/50MBFile.zip");
String fileName = file.getName();
Map<String, Object> props = new HashMap<String, Object>();
props.put("cmis:objectTypeId", "cmis:document");
props.put("cmis:name",fileName);
String mimetype = "application/octet-stream";
ContentStream contentStream = session.getObjectFactory().createContentStream(fileName,
file.length(),
mimetype,
new FileInputStream(file));
VersioningState versioningState = null;
Document someDoc = someFolder.createDocument(props, contentStream, versioningState );
我使用了 AtomPub 绑定。我的代码或我需要更改的任何其他 SharePoint/CMIS 设置有问题吗?
线程“主”org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException 中的异常:在 org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(AbstractAtomPubService.java:487) 中找到.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.post(AbstractAtomPubService.java:629) 在 org.apache.chemistry.opencmis.client.bindings.spi.atompub.ObjectServiceImpl.createDocument(ObjectServiceImpl.java: 119) 在 org.apache.chemistry.opencmis.client.runtime.FolderImpl.createDocument(FolderImpl.java:95) 在 org.apache.chemistry.opencmis.client.runtime.SessionImpl.createDocument(SessionImpl.java:751) 在 org .apache.chemistry.opencmis.client.runtime.FolderImpl.createDocument(FolderImpl.java:469) 在 UploadLargeFile.main(UploadLargeFile.java:31)
第 31 行对应于“Document someDoc = someFolder.createDocument(props, contentStream, versioningState);”