Read externalized property file in portlet web application

Hi All,

Is it possible to read externalized property files in portlet application by using relative path? If not, could you please advise the best way to read externalized property files in portlet web application?

Per my observation, with relative path - system is loading property file only if the file is present inside web application but not able to access it if the file is externalized.

Kind regards,
Raj

What is your file relative to?

Hi Eric,
CAF pacakge got deployed at <wm_home>/MWS/server/default/deploy/

External file is present at

<wm_home>/MWS/server/default/deploy/portal.war/foldername/filename.xml

regards,
Raj

MWS has some file locators to resolve the real file location for paths:

For example:

//get the real file location
String realFileLocation = com.webmethods.rtl.util.FileUtil.getRealLocation("webroot:/foldername/filename.xml");

//or get an input stream for the file content
InputStream fileInputStream = com.webmethods.rtl.util.FileUtil.getInputStream("webroot:/foldername/filename.xml");

The webroot:/ prefix resolves from MWS/server/default/deploy/portal.war/

…and there are other resolvers for other roots:
The dist:/ prefix resolves from MWS/
The root:/ prefix resolves from MWS/server/default/
The deploy:/ prefix resolves from MWS/server/default/deploy/

Thanks Eric for your inputs. It worked.

regards,
Raj