Get a list of resources from classpath directory

前端 未结 14 1103
予麋鹿
予麋鹿 2020-11-22 05:20

I am looking for a way to get a list of all resource names from a given classpath directory, something like a method List getResourceNames (String direct

14条回答
  •  春和景丽
    2020-11-22 05:56

    So in terms of the PathMatchingResourcePatternResolver this is what is needed in the code:

    @Autowired
    ResourcePatternResolver resourceResolver;
    
    public void getResources() {
      resourceResolver.getResources("classpath:config/*.xml");
    }
    

提交回复
热议问题