Creates a new NetworkConfig instance configured with details supplied in a YAML file.

@param configFile The file containing the network configuration
@return A new NetworkConfig instance
@throws InvalidArgumentException
@throws IOException
430181
public static NetworkConfig fromYamlFile(File configFile) throws InvalidArgumentException, IOException, NetworkConfigurationException {
        return fromFile(configFile, false);
    }
339455
private static Properties load(String configFilePath)
	{
		Properties props = new Properties();
		BufferedInputStream fis = null;
		try {
			File configFile = new File(configFilePath);
	        fis = new BufferedInputStream(new FileInputStream(configFile));
	        props.load(fis);
        }
        catch(IOException e){
        	System.err.println("Could not load configuration file "+configFilePath);
        }
        finally{
			if(fis!=null){
			    try {
					fis.close();
				}
				catch (IOException e) {
		        	System.err.println("Error closing file stream of configuration file "+configFilePath);
				}
			}
        }
        return props;
	}
513830
private void save(OneOrOther<File, Path> configFile) throws IOException {
		if (configFile.isOne()) {
			File config = configFile.getOne();
			this.saveToWriter(getFileWriter(config));
		} else {
			Path config = configFile.getOther();
			this.saveToWriter(getPathWriter(config));
		}
	}
287922
public static function getInstance($configFile='config.yml')
    {
        static $instance = null;
        if (null === $instance) {
            $instance = new static();
        }

        $configuration = Yaml::parse(file_get_contents($configFile));
        $instance->setParams($configuration);

        return $instance;
    }
7283
private static synchronized void initializeLog4JSubSystem(String configFile)
    {
        LoggerFactory.getBootLogger().info("Initializing Log4J using file: '" + configFile + "'");
        if(configFile == null || "".equals(configFile.trim()))
        {
            // no configuration available
            LoggerFactory.getBootLogger().warn("No log4j configuration file specified");
        }
        else
        {
            // try resource look in classpath
            URL url = ClassHelper.getResource(configFile);
            LoggerFactory.getBootLogger().info("Initializing Log4J : resource from config file:" + url);
            if (url != null)
            {
                PropertyConfigurator.configure(url);
            }
            // if file is not in classpath try ordinary filesystem lookup
            else
            {
                PropertyConfigurator.configure(configFile);
            }
        }
        log4jConfigured = true;
    }
882548
private function loadConfigFile($configFile)
    {
        if ($this->useCache) {
            if (function_exists('apc_fetch')) {
                $config = apc_fetch($configFile);
            } elseif (function_exists('apcu_fetch')) {
                $config = apcu_fetch($configFile);
            }

            if (!empty($config)) {
                return $config;
            }
        }

        if (!is_readable($configFile)) {
            throw new FileNotFoundException("File $configFile could not be found.");
        }

        try {
            $config = $this->parser->parse(file_get_contents($configFile));
        } catch (ParseException $e) {
            $line = $e->getParsedLine();
            throw new InvalidConfigFileException(
                "File $configFile does not have a valid format (line $line)"
            );
        }

        if ($this->useCache) {
            if (function_exists('apc_store')) {
                apc_store($configFile, $config);
            } elseif (function_exists('apcu_store')) {
                apcu_store($configFile, $config);
            }
        }

        return $config;
    }
1306548
func newConfigFile(fileNames []string) *ConfigFile {
	c := new(ConfigFile)
	c.fileNames = fileNames
	c.data = make(map[string]map[string]string)
	c.keyList = make(map[string][]string)
	c.sectionComments = make(map[string]string)
	c.keyComments = make(map[string]map[string]string)
	c.BlockMode = true
	return c
}
352293
def GenerateNetworkedConfigFile(load_hook, normal_class_load_hook, normal_class_dump_hook, **kwargs) -> NetworkedConfigObject:
    
    def NetworkedConfigObjectGenerator(url, safe_load: bool=True):
        cfg = NetworkedConfigObject(url=url, load_hook=load_hook, safe_load=safe_load,
                                    normal_class_load_hook=normal_class_load_hook,
                                    normal_class_dump_hook=normal_class_dump_hook)
        return cfg

    return NetworkedConfigObjectGenerator
160710
protected function loadConfiguration($configFile = false)
    {
        if ($configFile === false) {
            return;
        }
        echo "\nLoad configuration";

        $configuration = require $configFile;

        foreach ($configuration as $name => $value) {
            if ($this->module->canSetProperty($name) == true) {
                $this->module->$name = $value;
            } else {
                throw new InvalidConfigException("Invalid configuration. Unknown configuration option '{$name}'");
            }
        }
        $this->module->loadComponents();
    }
24179
@Override
    public void setFile(File file) {
        configFile = file;
        if (tc.isDebugEnabled())
            Tr.debug(tc, "Jaspi configuration of persistent providers will be stored in file: " + file);
    }
969635
public static function loadSettings($iniFile)
    {
        if (!file_exists($iniFile)) {
            throw new \Genesis\Exceptions\InvalidArgument(
                'The provided configuration file is invalid or inaccessible!'
            );
        }

        $settings = parse_ini_file($iniFile, true);

        foreach ($settings['Genesis'] as $option => $value) {
            if (array_key_exists($option, self::$vault)) {
                self::$vault[$option] = $value;
            }
        }

        foreach ($settings['Interfaces'] as $option => $value) {
            if (array_key_exists($option, self::$interfaces)) {
                self::$interfaces[$option] = $value;
            }
        }
    }
258168
private static ChaincodeCollectionConfiguration fromFile(File configFile, boolean isJson) throws InvalidArgumentException, IOException, ChaincodeCollectionConfigurationException {

        // Sanity check
        if (configFile == null) {
            throw new InvalidArgumentException("configFile must be specified");
        }

        if (logger.isTraceEnabled()) {
            logger.trace(format("ChaincodeCollectionConfiguration.fromFile: %s  isJson = %b", configFile.getAbsolutePath(), isJson));
        }

        // Json file
        try (InputStream stream = new FileInputStream(configFile)) {
            return isJson ? fromJsonStream(stream) : fromYamlStream(stream);
        }

    }
518541
public static final void xmlConfig(File configFile) throws IOException
    {
        try
        {
            JAXBContext jaxbCtx = JAXBContext.newInstance("org.vesalainen.util.jaxb");
            Unmarshaller unmarshaller = jaxbCtx.createUnmarshaller();
            JavaLoggingConfig javaLoggingConfig = (JavaLoggingConfig) unmarshaller.unmarshal(configFile);
            Map<String,String> expressionMap = new HashMap<>();
            Properties properties = javaLoggingConfig.getProperties();
            if (properties != null)
            {
                for (Element element : properties.getAny())
                {
                    String property = element.getTagName();
                    String expression = element.getTextContent();
                    expressionMap.put(property, expression);
                }
            }
            ExpressionParser ep = new ExpressionParser(expressionMap);
            for (LoggerType loggerType : javaLoggingConfig.getLogger())
            {
                String name = ep.replace(loggerType.getName());
                JavaLogging javaLogging = getLogger(name);
                Logger logger = javaLogging.getLogger();
                String lev = ep.replace(loggerType.getLevel());
                Level level = lev != null ? BaseLogging.parseLevel(lev) : null;
                if (level != null)
                {
                    logger.setLevel(level);
                }
                logger.setUseParentHandlers(parseBoolean(ep.replace(loggerType.getUseParentHandlers())));
                String resourceBundleString = ep.replace(loggerType.getResourceBundle());
                if (resourceBundleString != null)
                {
                    Locale locale;
                    String languageTag = ep.replace(loggerType.getLocale());
                    if (languageTag != null)
                    {
                        locale = Locale.forLanguageTag(languageTag);
                    }
                    else
                    {
                        locale = Locale.getDefault();
                    }
                    ResourceBundle resourceBundle = ResourceBundle.getBundle(resourceBundleString, locale);
                    logger.setResourceBundle(resourceBundle);
                }
                logger.setFilter(getInstance(ep.replace(loggerType.getFilter())));
                for (ConsoleHandlerType consoleHandlerType : loggerType.getConsoleHandler())
                {
                    logger.addHandler(createConsoleHandler(ep, consoleHandlerType, level));
                }
                for (FileHandlerType fileHandlerType : loggerType.getFileHandler())
                {
                    logger.addHandler(createFileHandler(ep, fileHandlerType, level));
                }
                for (MemoryHandlerType memoryHandlerType : loggerType.getMemoryHandler())
                {
                    logger.addHandler(createMemoryHandler(ep, memoryHandlerType, level));
                }
                for (SocketHandlerType socketHandlerType : loggerType.getSocketHandler())
                {
                    logger.addHandler(createSocketHandler(ep, socketHandlerType, level));
                }
            }
        }
        catch (JAXBException ex)
        {
            throw new RuntimeException(ex);
        }
    }
70269
public final void setConfiguration(final URI newConfigFile, final byte[] configFileData)
            throws IOException {
        this.configFile = new File(newConfigFile);
        this.configuration = this.configurationFactory
                .getConfig(this.configFile, new ByteArrayInputStream(configFileData));
    }
1027805
private function createConfigFromFile(string $configFile) : Config
    {
        $ini = parse_ini_file($configFile);
        return new Config($ini['token'] ?? '', $ini['provider'] ?? Config::PROVIDER_GITHUB);
    }
490284
public static ClientInterface getConfigRestClientUtil(String elasticSearch,String configFile){
		ElasticSearch elasticSearchSink = getElasticSearchSink( elasticSearch);
		return elasticSearchSink.getConfigRestClientUtil(configFile);
	}
1299257
public static CacheConfiguration build(File file) throws IOException {
		ConfigMap<String, String> config = ConfigMap.load(file);
		return CacheConfiguration.build(config);
	}