private void init(String glob, String... excludes) throws IOException {
		String resolved = CommandLinePropertySourceOverridingListener.getCurrentEnvironment().resolvePlaceholders(glob);
		int protocolColon = resolved.indexOf(':');
		String withoutProtocol = protocolColon != -1 ? resolved.substring(protocolColon + 1) : resolved;
		Pattern capturing = Pattern.compile(".*" + withoutProtocol.replace("*", "([^/]*)") + ".*");

		PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
		for (Resource r : resolver.getResources(resolved)) {
			if (!shouldConsider(r)) {
				continue;
			}
			String path = r.getURL().toString();
			Matcher matcher = capturing.matcher(path);
			if (!matcher.matches()) {
				throw new IllegalStateException(
						String.format("Expected to match '%s' with regex '%s'", path, capturing));
			}
			possibleValues.add(matcher.group(1));
		}

	}
An {@link OptionHandler} that scans a resource pattern for existing resources (using a single '*' wildcard) and
allows all String values <i>s</i> that would fit if that single wildcard was replaced by <i>s</i>.

<p>
Given that an option handler has to appear as an annotation parameter, expected usage is to sublcass this class,
provide the canonical 3 arg constructor to {@link OptionHandler} and pass the resource pattern as the 4th argument.
</p>

@author Eric Bottard
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/server/options/ResourcePatternScanningOptionHandler.java