I usually create a structure where I have the src / directory, and then other directories exist at the same level. Some of these directories include:
- lib / - External libraries
- config / - Configuration files
- resources / - Various resources that I use (images, etc.)
At the same level, I create an Ant script to execute my build so that the corresponding configuration files, resources, lib, etc. were copied to my JAR file during assembly. He did a great job for me until this moment and quite easily understands the organizational structure.
Update . My configuration files are usually accessed by locating them and opening them and reading them in code. Since I use Ant to build, I am sure my configuration files are in the place I expect. So, for example, in a recent application that I created when I compile, my JAR file is in the top-level directory (relative to the release structure of the application). Then at the same level there is a โmainโ configuration file. And there is a โthemeโ configuration file, which is located in the themes folder.
To read various files, I just open them, like any other file, and read them and go from there. This is nothing special, but it works well, and it makes it easier to manually change the settings if I need it.
source share