Posted: 7 May 2018 2:51 EDT Last activity: 7 May 2018 8:09 EDT
I have to get properties from custom classic properties files, so I tried to use getJavaPropertyFromFile, but I failed to do it. To test I put such a file in Pega tempdir, I can see it, but getJavaPropertyFromFile function don't seem to see it.
The only file I succeeded to read with getJavaPropertyFromFile is the log4j.properties, although I don't know where it is and I didn't had to indicate a directory (I tried this file just to test because I know it exists in java projects).
So I've coded a little java function to read my files and I call it in a Datatransform, it works very well but I'd rather use getJavaPropertyFromFile because I think it is done to do it, but it seems I don't know how to use it correctly.
What surprises me is that the only file I can read with getJavaPropertyFromFile is a file I don't see myself, so I think perhaps properties files have to be in a particular directory, or maybe specified in java classpath?
I don't know... Do you have an idea?
Thanks in advance for your help!
Please check the history of getJavaPropertyFromFile. It will read the properties file specified from the classpath.
History: Attempt to load the java properties file specified from the classpath. Once the file is loaded, return the string associated with the key. We will always return a string, so if the property can't be found or there was an exception loading the file we return the empty string.