I know there's a .getResource(String name)
method in Java, but is there like a .setResource(String name, File f)
, or something like that, in Java?
I'm asking because I want to create a save file, but I don't want the user to see them (unless the purposefully try to find it).
Cheers!
Top comments (8)
You could also create a file and make it hidden, as e.g. described in javacodeexamples.com/make-file-hid....
I wouldn't advise using your jar file for storage. That's not what it is meant for and as such you'll likely encounter more and more difficulties along the way.
Okay, well, then I should probably go about encoding the data?
Because, if possible, I want to do all I can to prevent file tampering.
Thanks for the suggestion, it really helps!
There are a number of ways to do that. This might be a reasonable starting point: baeldung.com/java-cipher-input-out...
Thanks for this.
Cheers!
Is there any way to do it if the
.jar
is not in use?How do I unzip/zip a
.jar
file programmatically?The same one.
Thank you for your help.