I have two resource folders.
src - here are my .java files
Resources
- here are my resource files (images, .properties) organized in folders (packages).
Is there a way to programmatically add another .properties file to this resource folder?
I tried something like this:
public static void savePropertiesToFile(Properties properties, File propertiesFile) throws IOException { FileOutputStream out = new FileOutputStream(propertiesFile); properties.store(out, null); out.close(); }
and before that created:
new File("/folderInResources/newProperties.properties");
But he is looking for this path in the file system. How to make it search in the resource folder?
EDIT . Let me tell you what it is about. I have a GUI application and I support 2 languages (2 .properties files in the resources folder). Now I have added an option that the user can easily translate the application, and when he finishes, I will save these new .properties to disk in some hidden folder and read it from there. But I was hoping that I could save the new .properties files (new language) next to the current languages (resource folders). I have a static message class that knows how to load resources both from disk and by default in the resource folder. But if the user takes this .jar file on some other machine, he will have such new languages, since they are located on the disk on this computer, and not inside the .jar file.
source share