what is the best solution to create file path in Java for this two OS. Application will be used for this os , the i need to create universal String.
for example : For Linux:
public File folderTxt = new File("/home/romankooo/work/txt/");
For Windows:
public File folderTxt = new File("C:\\PDFMalwareDataAnalyser\\Txt\\");
Or is the best solution to generate 2 .jar files for this OS.
Thank a lot guys.
The best thing is to let java decide that for you like this
public File folderTxt = new File(File.separator + "home" + File.separator + "romankooo" + File.separator + "work" + File.separator + "txt" + File.separator);
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