Modifying the contents of the Jar
Right, now I'm sure there are all sorts of faults with doing this, but call it curiosity.
The set-up is this; a program that requires very simple persistence (think a handful of numbers). What I'm thinking is this; rather than have a file at a user specified location (and them having to load it) is it possible to store the file inside the jar in one place, then each time the program loads to access and then modify this file? I'm guessing even if this is possible, it wouldn't be done the same as writing/reading a regular file?
Is this possible?
If so, how on earth would you go about doing it?
And if it is possible, why shouldn't you do it (as in is it just silly, problem causing etc.)?
Thanks for your time!
Re: Modifying the contents of the Jar
A .jar file basically is a .zip file and even those zip utilities have to remove the old entry, add a new zip entry and basically have to create an entirely new .zip file. If you want to do that, it can be done, otherwise it would be easier to create a separate file copy of the entry and modify the copy.