10-14-2014 11:18 AM
10-23-2014 09:54 PM
import org.apache.chemistry.opencmis.commons.*
import org.apache.chemistry.opencmis.commons.data.*
import org.apache.chemistry.opencmis.commons.enums.*
import org.apache.chemistry.opencmis.client.api.*
def cmis = new scripts.CMIS(session)
Folder newFolder = cmis.getFolder("/");
final String textFileName = "test.txt";
String mimetype = "text/plain; charset=UTF-8";
String content = "This is some test content";
String filename = textFileName;
byte[] buf = content.getBytes("UTF-8");
ByteArrayInputStream input = new ByteArrayInputStream(buf);
ContentStream contentStream = session.getObjectFactory().createContentStream(filename, buf.length, mimetype, input);
Map<String, Object> props = new HashMap<String, Object>();
props.put(PropertyIds.OBJECT_TYPE_ID, "cmis:document");
props.put(PropertyIds.NAME, "filename");
Document doc = newFolder.createDocument(props, contentStream, VersioningState.MAJOR);
10-30-2014 09:43 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.