In my SpringBoot project I would like to read an image file located in:
I tried:
URL url = getClass().getResource("android.png"); File f = new File(url.getPath()); and:
URL url = getClass().getResource("static/images/android.png"); File f = new File(url.getPath()); but the result is null.
EDIT: this worked
try { File file = new ClassPathResource("static/images/android.png").getFile(); } catch (IOException e) { } 
this.getClass().getClassLoader().getResource("static/images/android.png")