Where is the best folder to put configuration file read by java service?

Hi,

I created a java service which read its configurations from a file named: app.properties.

I want to know where is the best folder to put the app.properties file in the package folder?

I thought the “config” folder would be the suitable one, but I’m not sure if it’s a appropriate place.

I also found other people put configuration file in “pub” folder. What’s the difference between “config” and “pub” folder?

Thanks.

The config directory is appropriate for configuration files.

The pub directory is intended for publicly available files, such as documentation. IS provides support for accessing files in this directory via an URL of this form:

[url]http://phx-eaieda-iut1:8010/[/url][I]packagename[/i]/[I]filename[/i]

If you want the file to be viewable via browser (with the proper permissions) then it may be appropriate to put in the pub directory.

If the configuration file will vary by environment then you may consider putting the file outside of the package–otherwise deployments of the package will overwrite the file. A practice I’ve seen is to have directory named properties (or other appropriate name) under the Integration Server install directory.

Hi reamon,

Thanks very much for your explanation.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.