Hello Folks,
I have tried out content encryption.decryption in Alfresco.It woks fine.
But when I decrypt the content the decrypted file is saving in Alfresco Company Home as separete file instead of Alfresco Guest home..
Below is the coding part which will create a file into user home space and write the decrypted content in to it.
//create a file into the user home's space
//and write the decrypted content into it.
nodeProperties.clear();
nodeProperties.put(ContentModel.PROP_NAME,namefile+"."+plainContentExt );
ChildAssociationRef assocRef = this.nodeService.createNode(
homeRef,
ContentModel.ASSOC_CONTAINS,
QName.createQName(NAMESPACE, QName.createValidLocalName(namefile+"."+plainContentExt)),
ContentModel.TYPE_CONTENT,
nodeProperties);
NodeRef fileRef = assocRef.getChildRef();
ContentWriter writer=this.contentService.getWriter(fileRef,ContentModel.PROP_CONTENT,true);
writer.setEncoding(ENCODING);
writer.setMimetype(reader.getMimetype());
writer.putContent(ciph.getOutputAsFile());
Below is the code to write Encrypted content
this.nodeService.setProperty(actionedUponNodeRef,ContentModel.PROP_NAME,plainFileName.toString()+EXT);
ContentWriter writer=this.contentService.getWriter(actionedUponNodeRef,ContentModel.PROP_CONTENT,true);
writer.setEncoding("UTF-8");
writer.setMimetype(MIME);
writer.putContent(ciph.getOutputAsFile());
Please suggest me that how to create the decrypted file(not a separate file) is on the Alfresco Guest home.
Thanks,
Thiru