Hi,I've a configuration file (mymodule-config.properties) uploaded to the Data Dictionary so that the admin is able to override some module settings with it. Now I try to detect in my Webscript code if this file is available at all and if available, I'll read the content to a java.util.Properties object. But I dont get it up and running…The code to read the content of the document:
…
NodeRef nodeDocument = resultSetAllDocuments.getChildAssocRef(0).getChildRef();
ContentService contentService = serviceRegistry.getContentService();
ContentReader contentReader = contentService.getReader(nodeDocument, ContentModel.PROP_CONTENT);
InputStream is = contentReader.getContentInputStream();
Properties myProps = new Properties();
myProps.load(is);
…
Instead the file content I'll get the following:
Error: org.alfresco.service.cmr.repository.ContentIOException: 02200007 Failed to open stream onto channel:
accessor: ContentAccessor[ contentUrl=store://2014/3/20/14/21/cd19ab69-aaa1-43f1-b17b-caa646bc8965.bin, mimetype=text/plain, size=206, encoding=UTF-8, locale=en_US]
How can I read the file content? I tried also already both versions mentioned in https://wiki.alfresco.com/wiki/NodeRef_cookbook#Reading_the_data_content_of_a_NodeRef_.28plain_text.29 but none of them works. Always the same error even if I use the approach with the String:
contentReader.getContentString();
I'm using Alfresco 4.2.1 Enterprise.Just to complete: The content of the document is something like
mySetting1 = 123
mySetting2 = abc
mySetting3 = false