I have an input file data, name input.dat
which is stored in the src/main/resources
. When I tried to read from this input file as follows:
String[] lines = Files.readAllLines(new File("input.dat").toPath()).toArray(new String[0]);
I received the following exception:
java.nio.file.NoSuchFileException: input.dat
Can anyone help me with what did I do wrong here? Thank you in advance!