FileInputStream fis = new FileInputStream(file);
DataInputStream dis = new DataInputStream(fis);
byte[] bytes = new byte[(int) file.length()];
dis.readFully(bytes);
Map newDocProps = new HashMap();
newDocProps.put(PropertyIds.OBJECT_TYPE_ID, "cmis:document,P:cm:titled,P:sc:webable");
newDocProps.put(PropertyIds.NAME, file.getName());
newDocProps.put("cm:title", "modulo A1");
newDocProps.put("cm:description", "Tiff modulo A1 accorpati");
newDocProps.put("sc:isActive", true);
List addAces = new LinkedList();
List removeAces = new LinkedList();
List policies = new LinkedList();
try {
ContentStream contentStream = new ContentStreamImpl(file.getAbsolutePath(), null, "application/pdf",
new ByteArrayInputStream(bytes));
org.apache.chemistry.opencmis.client.api.Document doc = target.createDocument(newDocProps, contentStream,
VersioningState.NONE, policies, removeAces, addAces, session.getDefaultContext());
AlfrescoDocument alfDoc = (AlfrescoDocument) doc;
alfDoc.addAspect("P:sc:webable");
} catch (Exception e) {
e.printStackTrace();
}
Archive content from product discussions in Italian.
This group is now closed and content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.