Since Java 7, you can do this with this wonderfull line :
new String(Files.readAllBytes(Paths.get(this.getClass().getResource("/file.txt").toURI())))
That makes Java powerfull and I love that.
new String(Files.readAllBytes(Paths.get(this.getClass().getResource("/file.txt").toURI())))
That makes Java powerfull and I love that.