I am trying to get hold of a file ( or a directory ) under /WEB-INF/.../
outside of a request. I need it in a bean loaded at server startup.
A
You can use classpath resource if the file is located in the WEB_INF\classes
directory. Which is where any files in your src/main/resources
directory will be copied to using a normal maven build ...
import org.springframework.core.io.Resource
...
final Resource yourfile = new ClassPathResource( "myfile.txt");