Saving a value permanently, not in the DataModel

I have succesfully readed content of a .txt file from an “activation” folder inside the URcap files folder with this Code:

String lineReaded = “”;
java.net.URL fileURL = getClass().getResource(“/<Folder inside “resources”>/FileToStore.txt”);
InputStreamReader inputReader = new InputStreamReader(getClass().getResouceAsStream(fileURL.getPath()));
BufferedReader reader = new BufferedReader (inputReader);
try{
lineReaded = reader.readLine();
//and so on, for loop or whatever
reader.close();
}catch (IOException e){
e.printStackTrace();
}

Is based in what I found here:
https://forum.universal-robots.com/t/loading-script-file-from-the-resources-folder/3391

But Im completly lost on Writing to that file. I readed all related topics in the forum(some resources has broken links) and googling for 12+ hours and maked 30+ test builds and nothing… Could someone share with me a code to put a “HelloWorld” into an existent .txt file???

@artiminds @SonglinCai @dozminkowski @jbm

… sorry to bother.