Replace the content of a file in a jar file dynamically.
807606Mar 2 2007 — edited Mar 2 2007Hello, everybody! I need your help.
In my application jar file I have a META-INF directory and inside this directory I have a file named persistence.xml. So, the persistence.xml is statically placed in my jar file; I cannot change it anymore once the jar is generated.
But I don't want this. I want to be able to load this file dynamically at runtime. I mean, in the user computer I want to create a file named persistence.xml, place it in the same directory where the jar file is and the application load this file with its content and replace the file that is inside the jar file. So, once loaded, my application will see the file that was loaded, not the file with the old content that is inside that jar file.
Maybe I have to use getResource or getResourceAsStream, but I don't know how to make these methods replace the file that is in the jar file.
Thank you in advance.
Marcos