I am doing this:
File file = new File(String.valueOf(getClass().getClassLoader().getResource("images/logo.png")));
in order to have the entire path file name.
But this instruction below fails:
byte[] fileContent = FileUtils.readFileToByteArray(file);
I am getting this exception:
java.io.FileNotFoundException: File 'file:\C:\Users\thomas\dev\workspace\myapp\target\classes\images\logo.png' does not exist
It's because it needs to have double backslash instead of single backslash (OS: Windows). Is there a way to get rid of this?