Java export .properties file to build folder? -


I have just created a .properties file in Java and the problem is that to get it working is where to store it is. I am currently developing a "Dynamic Web Project" in Eclipse, and I am storing property files under properties / files / myfile.properties, and I am using this code to load it: / P>

  properties.load (this.getClass () getResourceAsStream ("/ myfile.properties").);  

But will this folder not be shortened while building the project, or will not be included while exporting as a war file? How can I add this file to the build path, so it will be added to each build / build / classes (in Eclipse)?

If you add your .properties file to the source folder, Will be copied. I can usually make a separate "source folder" in my projects. Properties files and other non-Java source files.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -