Domanda

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??

È stato utile?

Soluzione

I solved it with

  alfDoc.setContentStream(content, true, true);
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top