문제

I'm trying to replace a document on alfresco with Apache chemistry. I create an inputstream from a file stored on disk, i create a contenstream with the constructor ContentStreamImpl and i try to replace the document with the .setContentStream method. The result of this operation is

org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException: Internal Server Error

This is the part of my code:

        InputStream newDoc = new FileInputStream(global.getPathTemp() + filename);
        ContentStream content = new ContentStreamImpl("Prova", BigInteger.valueOf(newDoc.available()), mimetype, newDoc);

        alfDoc.setContentStream(content, true);

Can someone help me??

도움이 되었습니까?

해결책

I solved it with

  alfDoc.setContentStream(content, true, true);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top