0

I am trying to read a property file from a spring boot project

InputStream in = new FileInputStream(ResourceUtils.getFile("classpath:myspecialconfig.properties"));

This file is present in main/resources. So in effect reaches BOOT-INF\classes

But I get the error

class path resource [myspecialconfig.properties] cannot be resolved to absolute file path because it does not reside in the file system: jar:file:myjar.jar!/BOOT-INF/classes!/myspecialconfig.properties

TomJava
  • 499
  • 1
  • 8
  • 24
  • I don't think you need classpath: at all to load it, but as answer suggested there are better ways of doing it – nafas May 07 '20 at 12:40
  • 2
    Maybe this will help https://stackoverflow.com/questions/15749192/how-do-i-load-a-file-from-resource-folder – PatrickChen May 07 '20 at 13:16

0 Answers0