If only java.io blocked (you said that java.io import is blocked), you can use java.nio to write to files.
Look at the Files center. In java.nio files / folders are represented by java.nio.Path objects, which are also part of the java.nio package (and not java.io ).
Example record "Hello World!" to text file to disk:
Files.write(Paths.get("/your/folder/text.txt"), "Hello World!".getBytes(StandardCharsets.UTF_8));
source share