How can I read a configuration xml file using nuxeo api

geekonspace
Star Contributor
Star Contributor

I have a xml file and want to know how to read it using your api. The file is in my plugin folder

1 ACCEPTED ANSWER

Florent_Guillau
World-Class Innovator
World-Class Innovator

You should put it in the config/ directory.

Then you can use Environment.getConfig() to get that path from your code. Then use standard XML file reading mechanisms.

Or use URL url = context.getRuntimeContext().getResource("config/your-file.xml") and read the XML from that URL.

View answer in original post

2 REPLIES 2

Florent_Guillau
World-Class Innovator
World-Class Innovator

You should put it in the config/ directory.

Then you can use Environment.getConfig() to get that path from your code. Then use standard XML file reading mechanisms.

Or use URL url = context.getRuntimeContext().getResource("config/your-file.xml") and read the XML from that URL.

thanks!!!!