Read a file from resources directory
There comes a time when you need to read a file from the resource folder of your project. You could have a file you want to read in the src/main/resources or src/test/resources directory. In this tutorial, I am going to show you how to read a file from your production or testing code.
Using NIO files The most straightforward way to read a file is to the files belonging to the NIO (New Input/Output) package.