@Value("file:" + "${d:/my/dir/}")
private Resource dir;
How can I get the number of files in that resource dir? Unfortunately the Resource
interfaces does not offer any getFiles() method...
@Value("file:" + "${d:/my/dir/}")
private Resource dir;
How can I get the number of files in that resource dir? Unfortunately the Resource
interfaces does not offer any getFiles() method...
Based on this version of the Resource interface, you can call getFile
File theDir = dir.getFile();
if (theDir.isDirectory()) {
theDir.list();
}
if you combine this with the propertyplaceholderconfigurer you might get what you're lookign for: