Sometimes I have to remind myself that a jar is basically a zip file, not a file folder. URL's can be used to read the contents when File commands fail to see inside. My recollection when looking into this before is that writing inside of a jar is theoretically possible but so troublesome and complicated that it is pretty much never done.
Java gives you access to some standard file locations via
System Properties. I have done the thing of setting up a file folder specific to the application within the address given by the following code:
1
| String fileLoc = System.getProperty("user.home"); |
and then making use of that folder for persistent storage. In Windows, the user.home is the folder that holds common folders like "Desktop" and "Documents" for a specific User.