Writing to files within jar files
I am trying to write to a text file in my program, which is packaged as a jar file. To read from files, I use
which returns an input stream, but I can't find any way to get an output stream that works in a jar file. An example of some code which works in eclipse but not in the jar packaging is:
Please help me!
URL url = getClass().getResource(fileName);
PrintWriter writer = new PrintWriter(url.getPath());