I need to create small files to save basic information. I can't read and write from the files once my project is exported as a JAR, so I created a folder to store the files outside of the src folder. This only works if I set the external folder to be a source folder.
This is the code where I create the folder
File f = new File("Characters");
try{
if(f.mkdir()) {
System.out.println("Directory created");
} else {
System.out.println("Directory not created");
}
} catch(Exception e){
e.printStackTrace();
}
How can I programmatically set this folder to be a source folder?
I hope this is specific enough.
These sound more like resource files rather then source files which require compiling.
Why not put them in a resource directory and load them when needed?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With