class ConfigURIFactory {

    URI newURI(String spec) throws URISyntaxException {
        String expanded = expand(spec);
        String fixed = fixBackslashesToSlashes(expanded);
        if (fixed.startsWith(CLASSPATH_PROTOCOL)) {
            String path = fixed.substring(CLASSPATH_PROTOCOL.length());
            URL url = classLoader.getResource(path);
            if (url == null)
                return null;
            return url.toURI();
        } else if (fixed.startsWith(FILE_PROTOCOL)) {
            // This check fixes the case where an environment variable has been
            // specified for the path to the config file, but that environment
            // variable is blank / undefined.
            if ( fixed.equals(FILE_PROTOCOL) ) {
                return new URI("");
            } else {
                String path = fixSpacesToPercentTwenty(fixed);
                return new URI(path);
            }
        } else {
            return new URI(fixed);
        }
    }

      ConfigURIFactory(ClassLoader classLoader, VariablesExpander expander);

}