使用方法:
ResourcePatternResolver resourcePatternResolver = new PathMatchingResourcePatternResolver();
Resource resource = resourcePatternResolver.getResource("youResourcePath");
如果不是根路径,需要指定路径,例如:
从类路径的rules目录下获取demo.drl文件
Resource resource = resourcePatternResolver .getResource("rules/demo.drl");
可以明确的指定classpath前缀:
Resource resource = resourcePatternResolver .getResource("classpath:rules/demo.drl");
使用通配符获取满足某种格式的文件
通过classpath*前缀指定从所有的类路径下获取指定的文件
Resource[] resource = resourcePatternResolver .getResource("classpath*:rules/demo.drl");</