Configures with a list of properties files, which could be on either the
file system (file: location) or the class path (classpath: location).
541275
public void setPropertiesLocations(List<String> locations) {
        Properties properties = null;
        PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
        for (String location: locations) {
            properties = load(properties, resolver, location);
        }
        if (properties != null && properties.size() > 0) {
            configure(properties);
        }
    }
574465
private void initializeConfigPropertiesFiles(ClassLoader cl, String fileName) {
        final String methodName = "initializeConfigPropertiesFiles()";

        if (tc.isEntryEnabled())
            Tr.entry(tc, methodName + " classLoader=" + cl + " fileName=" + fileName);
        try {
            Enumeration<URL> resources = cl.getResources(fileName);
            while (resources.hasMoreElements()) {
                URL url = resources.nextElement();
                if (!processedUrls.contains(url))
                    processConfigUrl(url);
            }
        } catch (Exception ex) {
        }
        if (tc.isEntryEnabled())
            Tr.exit(tc, methodName);
    }
1097668
@Override
    protected void configure() {
        // ***** Properties *****
        URL resource = getClass().getResource("/URIMapper.txt");
        if (resource == null) {
            log.debug("No /URIMapper.txt resource exists.");
        } else {
            bind(File.class).annotatedWith(Names.named("uri-mappings")).toInstance(
                    new File(resource.getFile()));            
        }
    }
1236615
private void initialize(@NotNull final String propertiesFilePath) {
        props = new Properties();
        try (InputStream in = FileUtils.getResourceAsStream(propertiesFilePath)) {
            props.load(in);
        } catch (NullPointerException ex) {
            LOGGER.error("Did not find settings file '{}'.", propertiesFilePath);
            LOGGER.debug("", ex);
        } catch (IOException ex) {
            LOGGER.error("Unable to load settings from '{}'.", propertiesFilePath);
            LOGGER.debug("", ex);
        }
        logProperties("Properties loaded", props);
    }
49931
public static void addArchiveToClassPath(Path archive, Configuration conf)
    throws IOException {
    URI uri = addArchiveToClassPathHelper(archive, conf);
    addCacheArchive(uri, conf);
  }
162762
private void addToClassPool(final Path location) {
        if (!location.toFile().exists())
            throw new IllegalArgumentException("The location '" + location + "' does not exist!");
        try {
            ContextClassReader.addClassPath(location.toUri().toURL());
        } catch (Exception e) {
            throw new IllegalArgumentException("The location '" + location + "' could not be loaded to the class path!", e);
        }
    }
852955
public void setClasspath(Path src) {
        if (classpath == null) {
            classpath = src;
        } else {
            classpath.append(src);
        }
    }
248129
public static void modifySelfConfig(String configAbsoluteClassPath, Map<IConfigKey, String> modifyConfig)
            throws IOException {
        OneProperties configs = otherConfigs.get(configAbsoluteClassPath);
        if (configs == null) {
            return;
        }
        configs.modifyConfig(modifyConfig);
    }
864644
public static Properties fileToProperties(String fileName, Configuration conf)
      throws IOException, ConfigurationException {

    PropertiesConfiguration propsConfig = new PropertiesConfiguration();
    Path filePath = new Path(fileName);
    URI fileURI = filePath.toUri();

    if (fileURI.getScheme() == null && fileURI.getAuthority() == null) {
      propsConfig.load(FileSystem.getLocal(conf).open(filePath));
    } else {
      propsConfig.load(filePath.getFileSystem(conf).open(filePath));
    }
    return ConfigurationConverter.getProperties(propsConfig);
  }
38318
public T setPropertiesFile(String path) {
    checkNotNull(path, "path");
    builder.setPropertiesFile(path);
    return self();
  }
353720
public Boolean loadPropertiesFile(String path) throws IOException
    {
        Properties prop = new Properties();
        InputStream input = null;

        try {

            input = new FileInputStream(path);
            prop.load(input);

            for(String key : prop.stringPropertyNames()) {
                String value = prop.getProperty(key);
                configs.put(key, value);
            }

            return true;
        } catch (IOException ex) {
            return false;
        }
    }
1299424
function path(properties, options) {
  if (!properties) return;
  var str = properties.path;
  if (options.includeSearch && properties.search) str += properties.search;
  return str;
}
279933
public static void addFileToClassPath(Path file, Configuration conf)
    throws IOException {
    String classpath = conf.get("mapred.job.classpath.files");
    conf.set("mapred.job.classpath.files", classpath == null ? file.toString()
             : classpath + System.getProperty("path.separator") + file.toString());
    URI uri = file.makeQualified(file.getFileSystem(conf)).toUri();

    addCacheFile(uri, conf);
  }
213441
@SuppressFBWarnings(value = "DMI_COLLECTION_OF_URLS", justification = "Only local URLs involved")
    private Map<ConfigurationKey, Object> readFileProperties(Set<URL> files) {
        Map<ConfigurationKey, Object> found = new EnumMap<ConfigurationKey, Object>(ConfigurationKey.class);
        for (URL file : files) {
            ConfigurationLogger.LOG.readingPropertiesFile(file);
            Properties fileProperties = loadProperties(file);
            for (String name : fileProperties.stringPropertyNames()) {
                processKeyValue(found, name, fileProperties.getProperty(name));
            }
        }
        return found;
    }
336028
function resolveSSLOptions(options) {
    var toReturn = _.clone(options);
    //Resolve the file-based properties
    _.forEach(_.keys(toReturn), function(key) {
        if (key === 'cert' || key === 'key' || key === 'pfx') {
            toReturn[key] = fs.readFileSync(path.resolve(global.__appDir, toReturn[key]));
        } else if (key === 'ca') { //this can be an array
            if (_.isArray(toReturn[key])) {
                //array
                toReturn[key] = _.map(toReturn[key], function(val) {
                    return fs.readFileSync(path.resolve(global.__appDir, val));
                });
            } else {
                //Single value
                toReturn[key] = fs.readFileSync(path.resolve(global.__appDir, toReturn[key]));
            }
        }
    });
    return toReturn;
}
1124756
private void mapClassResourceEntry(String fileName, Object location) {
		Object previouslyFoundLocation = mixedResourceLocations.get(fileName);
		if (previouslyFoundLocation != null && !previouslyFoundLocation.equals(location)) {
			//this may indicate a conflict
			//it occurs frequently for "/MANIFEST.MF" which shouldn't be a problem
			//it may occur for other resources
			//log those occurrences that seem suspicious
			registerMultipleLocations(fileName, location);
			return;
		}
		if (fileName.endsWith(".properties")) {
			String className = convertFileNameToClassName(fileName);
			propertiesResourceLocations.put(className, fileName);
		} else if (fileName.endsWith(".class")) {
			String className = convertFileNameToClassName(fileName);
			classResourceLocations.put(className, location);
		}
		mixedResourceLocations.put(fileName, location);
	}
915687
public void expandClasspath(File... files) {
        ClassLoader classLoader = ClassLoader.getSystemClassLoader();
        Class<URLClassLoader> urlClass = URLClassLoader.class;
        for (File file: files) {
            LOGGER.info("Expanding classpath to include: " + file.getAbsolutePath());
            URI fileUri = file.toURI();
            try {
                Method method = urlClass.getDeclaredMethod("addURL", URL.class);
                method.setAccessible(true);
                method.invoke(classLoader, fileUri.toURL());
            } catch (MalformedURLException | NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
                LOGGER.error("Error expanding classpath", e);
            }
        }
    }