I'm currently using this to read my files as inputStream, it works under windows, will this work in LINUX?
File file = new File(currentDirectory.getCanonicalPath().toString() + "\\" + "myfile.txt");
If not what is the right way to read files, this "\\" looks kind of "fishy"
ADD-ON
I forgot this :
File currentDirectory = new File(".");
Instead of hard-coding the filename separator, use File.separator there.
Better yet, use:
File file = new File(currentDirectory, "myfile.txt");
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