I want to save which recipe collection was last loaded into the application. The path of the most recently loaded serialized recipe collection object is stored in a .ser file inside the jar file of the application. And of course I can read this .ser file no Problem by using this getRessourceAsStream()
method. But writing doesn't seem to be possible. So how do I best save this .ser file storing the URI to the last loaded serialized object, so that writing is also possible?
EDIT: I don't want to save INSIDE a .jar because Class.getResourceAsStream(String)
as used here only returns an INPUTStream, but I need an OUTputStream to write to a file, which doesn't seem to be possible for .jar resources. So I want to know how I can accomplish what I need, saving an object in a .ser file which can be written to and read by the .jar, with the file stored outside of the .jar.