Example usage for org.springframework.core.io.support PathMatchingResourcePatternResolver getPathMatcher

List of usage examples for org.springframework.core.io.support PathMatchingResourcePatternResolver getPathMatcher

Introduction

In this page you can find the example usage for org.springframework.core.io.support PathMatchingResourcePatternResolver getPathMatcher.

Prototype

public PathMatcher getPathMatcher() 

Source Link

Document

Return the PathMatcher that this resource pattern resolver uses.

Usage

From source file:com.griddynamics.banshun.ContextParentBean.java

protected List<String> resolveConfigLocations(List<String> configLocations) throws Exception {
    PathMatchingResourcePatternResolver pmrpr = new PathMatchingResourcePatternResolver();

    for (String location : this.configLocations) {
        boolean wildcard = pmrpr.getPathMatcher().isPattern(location);
        List<String> collectedLocations = collectConfigLocations(location);

        for (String locName : collectedLocations) {
            if (!configLocations.contains(locName) && wildcard) {
                configLocations.add(locName);
            }// w  w  w.  ja va  2 s  .  c om
            if (!wildcard) {
                configLocations.remove(locName);
                configLocations.add(locName);
            }
        }
    }

    log.info("resolved locations: {}", configLocations);

    return configLocations;
}