read config from confingPath

@param confingFilename like axu4j.xml
2140
public static void load(String confingFilename) {
		try {
			if (config == null) {
				config = new AXUConfig();
				logger.debug("create new AXUConfig instance");
			}

            // DEV 모드인 경우 각 태그마다 config를 요청하므로 3초에 한 번씩만 설정을 로딩하도록 한다.
            long nowTime = (new Date()).getTime();
            if (nowTime - lastLoadTime < 3000) {
                return;
            } else {
                lastLoadTime = nowTime;
            }

			Serializer serializer = new Persister();
			URL configUrl = config.getClass().getClassLoader().getResource(confingFilename);
			if (configUrl == null) {
				configUrl = ClassLoader.getSystemClassLoader().getResource(confingFilename);
			}
			File configFile = new File(configUrl.toURI());
			
			serializer.read(config, configFile);
			
            logger.info("load config from {}", configFile.getAbsolutePath());
            if (logger.isDebugEnabled()) {
				logger.debug("axu4j.xml\n{}", config);
			}
		} catch(Exception e) {
			logger.error("Fail to load axu4j.xml", e);
		}
	}
689847
private com.microsoft.applicationinsights.TelemetryConfiguration readConfigurationFromFile() {
        final com.microsoft.applicationinsights.TelemetryConfiguration telemetryConfiguration =
            new com.microsoft.applicationinsights.TelemetryConfiguration();
        final Map<String, String> channelProperties = new HashMap<>();
        channelProperties.put(TelemetryChannelBase.FLUSH_BUFFER_TIMEOUT_IN_SECONDS_NAME, "1");
        final TelemetryChannel channel = new InProcessTelemetryChannel(channelProperties);

        telemetryConfiguration.setChannel(channel);
        telemetryConfiguration.setInstrumentationKey(readInstrumentationKeyFromConfiguration());

        TelemetryConfigurationFactory.INSTANCE.initialize(telemetryConfiguration);
        return telemetryConfiguration;
    }
45484
private void readConfig()
        throws CacheReloadException
    {
        Connection con = null;
        try {
            boolean closeContext = false;
            if (!Context.isThreadActive()) {
                Context.begin();
                closeContext = true;
            }
            final List<Object[]> dbValues = new ArrayList<>();
            con = Context.getConnection();
            PreparedStatement stmt = null;
            try {
                stmt = con.prepareStatement(SystemConfiguration.SQL_CONFIG);
                stmt.setObject(1, getId());
                final ResultSet rs = stmt.executeQuery();

                while (rs.next()) {
                    dbValues.add(new Object[] {
                                    rs.getLong(1),
                                    rs.getString(2),
                                    rs.getString(3),
                                    rs.getLong(4),
                                    rs.getString(5)
                    });
                }
                rs.close();
            } finally {
                if (stmt != null) {
                    stmt.close();
                }
            }
            con.commit();
            if (closeContext) {
                Context.rollback();
            }
            for (final Object[] row : dbValues) {
                final Long typeId = (Long) row[0];
                final String key = (String) row[1];
                final String value = (String) row[2];
                final Long companyId = (Long) row[3];
                final String appkey = (String) row[4];
                final Type type = Type.get(typeId);
                final ConfType confType;
                if (type.equals(CIAdminCommon.SystemConfigurationLink.getType())) {
                    confType = ConfType.LINK;
                } else if (type.equals(CIAdminCommon.SystemConfigurationObjectAttribute.getType())) {
                    confType = ConfType.OBJATTR;
                } else {
                    confType = ConfType.ATTRIBUTE;
                }
                values.add(new Value(confType, key, value, companyId, appkey));
            }
        } catch (final SQLException e) {
            throw new CacheReloadException("could not read SystemConfiguration attributes", e);
        } catch (final EFapsException e) {
            throw new CacheReloadException("could not read SystemConfiguration attributes", e);
        } finally {
            try {
                if (con != null && !con.isClosed()) {
                    con.close();
                }
            } catch (final SQLException e) {
                throw new CacheReloadException("Cannot read a type for an attribute.", e);
            }
        }
    }
701544
static ConfigurationStream resolveConfigFileAsStream(String configFilePath) throws ConfigurationException {
        InputStream fileStream;
        String fileExtention;
        
        if (configFilePath != null) {
            if (new File(configFilePath).isDirectory()) {
                String path = scanConfigFile(configFilePath);
                fileStream = getFileAsStream(new File(path));
                fileExtention = FilenameUtils.getExtension(path);
            } else {
                fileStream = getFileAsStream(configFilePath);
                fileExtention = FilenameUtils.getExtension(configFilePath);
            }
        } else if (hasEnvironmentVariable(ENVIRONMENT_CONFIG_VARIABLE_NAME)) {
            fileStream = getFileAsStream(getEnvironemtVariableConfigFilePath());
            fileExtention = FilenameUtils.getExtension(getEnvironemtVariableConfigFilePath().toFile().getName());
        } else if (hasSystemPropertyVariable(SYSTEM_PROPERTY_CONFIG_VARIABLE_NAME)) {
            fileStream = getFileAsStream(getSystemPropertyConfigFilePath());
            fileExtention = FilenameUtils.getExtension(getSystemPropertyConfigFilePath().toFile().getName());
        } else if (getClasspathResourceAsStream(CONFIG_FILE_NAME + "." + YML_EXTENTION) != null) {
            fileStream = getClasspathResourceAsStream(CONFIG_FILE_NAME + "." + YML_EXTENTION);
            fileExtention = YML_EXTENTION;
        } else if (getClasspathResourceAsStream(CONFIG_FILE_NAME + "." + YAML_EXTENTION) != null) {
            fileStream = getClasspathResourceAsStream(CONFIG_FILE_NAME + "." + YAML_EXTENTION);
            fileExtention = YAML_EXTENTION;
        } else if (getClasspathResourceAsStream(CONFIG_FILE_NAME + "." + XML_EXTENTION) != null) {
            fileStream = getClasspathResourceAsStream(CONFIG_FILE_NAME + "." + XML_EXTENTION);
            fileExtention = XML_EXTENTION;
        } else {

            String defaultConfigDir = System.getProperty("user.dir");
            String defaultConfigPath = scanConfigFile(defaultConfigDir);
            fileExtention = FilenameUtils.getExtension(defaultConfigPath);
            fileStream = getFileAsStream(new File(defaultConfigPath));
        }
        ConfigurationStream config = new ConfigurationStream();
        config.setExtention(fileExtention);
        config.setInputStream(fileStream);
        return config;
    }
688681
private static ConfigProvider<Configuration> getProviderByFileExtention(String extention) throws ConfigurationException {
        ConfigProvider<Configuration> provider;
        if (XML_EXTENTION.equals(extention)) {
            provider = new XMLConfigProvider<>(Configuration.class);
        } else if (YML_EXTENTION.equals(extention) || YAML_EXTENTION.equals(extention)) {
            provider = new YAMLConfigProvider<>(Configuration.class);
        } else {
            throw new ConfigurationException("Given file type is not supported.",
                    CONFIG_EXTENTION_NOT_SUPPORTED_EXCEPTION_ID);
        }

        return provider;
    }
1309645
private void parseInputConfig(final Node node, final ConfigSettings config)
	{

		String name, value;
		Node nnode;
		NodeList list = node.getChildNodes();

		int length = list.getLength();
		for (int i = 0; i < length; i++) {
			nnode = list.item(i);

			name = nnode.getNodeName().toUpperCase();
			if (name.equals(KEY_WIKIPEDIA_ENCODING)) {

				value = nnode.getChildNodes().item(0).getNodeValue();
				config.setConfigParameter(ConfigurationKeys.WIKIPEDIA_ENCODING,
						value);

			}
			else if (name.equals(KEY_MODE_SURROGATES)) {

				SurrogateModes oValue = SurrogateModes.parse(nnode
						.getChildNodes().item(0).getNodeValue());
				config.setConfigParameter(ConfigurationKeys.MODE_SURROGATES,
						oValue);

			}
			else if (name.equals(SUBSECTION_ARCHIVE)) {

				parseInputArchive(nnode, config);

			}
		}
	}
259655
def read_config(self, filename):
        
        if not os.path.exists(filename):
            raise Exception("Configuration file cannot be found: %s" % filename)
        with io.open(filename, encoding='UTF-8') as stream:
            return yaml.safe_load(stream)
1220987
@Override
    public Model read(Configuration config) {
        String name = config.getName();
        Descriptor desc = getDescriptor();
        if (MANIFEST.equals(name)) {
            return new V2ManifestModel(config, desc);
        } else if (REMOTE_JMS.equals(name)) {
            return new V2RemoteJmsModel(config, desc);
        } else if (REMOTE_REST.equals(name)) {
            return new V2RemoteRestModel(config, desc);
        } else if (EXTRA_JAXB_CLASSES.equals(name)) {
            return new V2ExtraJaxbClassesModel(config, desc);
        } else if (EXTRA_JAXB_CLASS.equals(name)) {
            return new V2ExtraJaxbClassModel(config, desc);
        } else if (INPUT.equals(name)) {
            return new V2InputModel(config, desc);
        } else if (PROPERTIES.equals(name)) {
            return new V2PropertiesModel(config, desc);
        }
        return super.read(config);
    }
1024773
@SuppressWarnings("unchecked") // when we cast yaml.load(fin)
  public static Map<String, Object> loadFile(String fileName) {
    Map<String, Object> props = new HashMap<>();
    if (fileName == null) {
      LOG.warning("Config file name cannot be null");
      return props;
    } else if (fileName.isEmpty()) {
      LOG.warning("Config file name is empty");
      return props;
    } else {

      // check if the file exists and also it is a regular file
      Path path = Paths.get(fileName);

      if (!Files.exists(path)) {
        LOG.fine("Config file " + fileName + " does not exist");
        return props;
      }

      if (!Files.isRegularFile(path)) {
        LOG.warning("Config file " + fileName + " might be a directory.");
        return props;
      }

      LOG.log(Level.FINE, "Reading config file {0}", fileName);

      Map<String, Object> propsYaml = null;
      try {
        FileInputStream fin = new FileInputStream(new File(fileName));
        try {
          Yaml yaml = new Yaml();
          propsYaml = (Map<String, Object>) yaml.load(fin);
          LOG.log(Level.FINE, "Successfully read config file {0}", fileName);
        } finally {
          fin.close();
        }
      } catch (IOException e) {
        LOG.log(Level.SEVERE, "Failed to load config file: " + fileName, e);
      }

      return propsYaml != null ? propsYaml : props;
    }
  }
262955
@Override
    protected synchronized void loadConfiguration() throws IOException {
        LOGGER.info("Loading list of allowed external content locations from {}", configPath);
        try (final Stream<String> stream = Files.lines(Paths.get(configPath))) {
            allowedList = stream.map(line -> normalizePath(line.trim().toLowerCase()))
                    .filter(line -> isAllowanceValid(line))
                    .collect(Collectors.toList());
        }
    }
1122300
protected static void loadConfig(final Properties config,
                                       final File f) {
        InputStreamReader r = null;

        try {
            final FileInputStream in = new FileInputStream(f);
            r = new InputStreamReader(in, "UTF-8");

            config.load(r);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (r != null) {
                try {
                    r.close();
                } catch (Exception e) {
                    e.printStackTrace();
                } // end of catch
            } // end of if
        } // end of finally
    }
117896
private function readConfigFile()
    {
        // reading the config file to be stored in the 'configurations' variable below
        $configurations = $this->config_reader->get('api');
        $this->mappers_base_namespace = $configurations['mappers'];
        $this->limit = $configurations['limit'];
    }
427113
public Configuration fromFile(File path) throws ConfigurationLoadException {
    PropertiesConfiguration configuration = setupConfiguration(new PropertiesConfiguration());
    configuration.setFile(path);
    try {
      configuration.load();
      return configuration;
    } catch (ConfigurationException e) {
      throw new ConfigurationLoadException(
          "Encountered a problem reading the provided configuration file \"" + path + "\"!", e);
    }
  }
648217
private void parseModeConfig(final Node node, final ConfigSettings config)
	{

		String name;
		Integer value;
		Node nnode;
		NodeList list = node.getChildNodes();

		int length = list.getLength();
		for (int i = 0; i < length; i++) {
			nnode = list.item(i);

			name = nnode.getNodeName().toUpperCase();
			if (name.equals(KEY_VALUE_MINIMUM_LONGEST_COMMON_SUBSTRING)) {

				value = Integer.parseInt(nnode.getChildNodes().item(0)
						.getNodeValue());
				config.setConfigParameter(
						ConfigurationKeys.VALUE_MINIMUM_LONGEST_COMMON_SUBSTRING,
						value);

			}
			else if (name.equals(KEY_COUNTER_FULL_REVISION)) {

				value = Integer.parseInt(nnode.getChildNodes().item(0)
						.getNodeValue());
				config.setConfigParameter(
						ConfigurationKeys.COUNTER_FULL_REVISION, value);

			}
		}
	}
642232
private static JNRPEConfiguration loadConfiguration(final String configurationFilePath) throws ConfigurationException {
        File confFile = new File(configurationFilePath);

        if (!confFile.exists() || !confFile.canRead()) {
            throw new ConfigurationException("Cannot access config file : " + configurationFilePath);
        }

        return JNRPEConfigurationFactory.createConfiguration(configurationFilePath);

    }
162623
private void parseExternalsConfig(final Node node,
			final ConfigSettings config)
	{

		String name, value;
		Node nnode;
		NodeList list = node.getChildNodes();

		int length = list.getLength();
		for (int i = 0; i < length; i++) {
			nnode = list.item(i);

			name = nnode.getNodeName().toUpperCase();
			if (name.equals(KEY_SEVENZIP)) {

				value = nnode.getChildNodes().item(0).getNodeValue();
				value = value.substring(1, value.length() - 1);

				config.setConfigParameter(ConfigurationKeys.PATH_PROGRAM_7ZIP,
						value);

			}
		}
	}
716435
function readConfig(configFileLocationIn = '', optionsIn = null) {

		var tmpCONFIG = '';
		if (configFileLocationIn == '') {
			readStream = fs.createReadStream(configFileLocation, 'utf8');
		} else {

			if (configFileLocationIn == 'cmd_default') {

				CONFIG = {};
				CONFIG.options = optionsIn;
				if (CONFIG.options.trim) {
					OPTIONS.trim_removed_rules_previous_comment = CONFIG.options.trim;
					OPTIONS.trim_comments = CONFIG.options.trim;
					OPTIONS.trim_whitespace = CONFIG.options.trim;
					OPTIONS.trim_breaklines = CONFIG.options.trim;
					OPTIONS.trim_last_semicolon = CONFIG.options.trim;
				}
				if (CONFIG.options.shorten) {
					OPTIONS.shorten_zero = CONFIG.options.shorten;
					OPTIONS.shorten_hexcolor = CONFIG.options.shorten;
					OPTIONS.shorten_hexcolor_extended_names = CONFIG.options.shorten;
					OPTIONS.shorten_font = CONFIG.options.shorten;
					OPTIONS.shorten_background = CONFIG.options.shorten;
					OPTIONS.shorten_margin = CONFIG.options.shorten;
					OPTIONS.shorten_padding = CONFIG.options.shorten;
					OPTIONS.shorten_list_style = CONFIG.options.shorten;
					OPTIONS.shorten_outline = CONFIG.options.shorten;
					OPTIONS.shorten_border = CONFIG.options.shorten;
					OPTIONS.shorten_border_top = CONFIG.options.shorten;
					OPTIONS.shorten_border_right = CONFIG.options.shorten;
					OPTIONS.shorten_border_bottom = CONFIG.options.shorten;
					OPTIONS.shorten_border_left = CONFIG.options.shorten;
					OPTIONS.shorten_border_radius = CONFIG.options.shorten;
				}
				if (CONFIG.options.special_reduce_with_html) {
					OPTIONS.special_reduce_with_html = CONFIG.special_reduce_with_html;
				}
				if (CONFIG.options.css_output) {
					OPTIONS.css_output = CONFIG.options.css_output;
				}
				if (CONFIG.options.verbose) {
					OPTIONS.verbose = CONFIG.options.verbose;
				}

				summary.files.output.push(CONFIG.options.css_output);
				REPORT_DUPLICATE_CSS = OPTIONS.report_file_location;
				CONFIG_REDUCE_DECLARATIONS = OPTIONS.reduce_declarations_file_location;
				summary.options_used = OPTIONS;

				CPEVENTS.emit('CONFIG_READ_END', OPTIONS);

				return true;
			} else { //custom
				readStream = fs.createReadStream(configFileLocationIn, 'utf8');	
			}
			
		}

		readStream.on('data', function(chunk) {  
			tmpCONFIG += chunk;
		}).on('end', function() {

			if (tmpCONFIG !== '') {
				try {
					CONFIG = JSON.parse(tmpCONFIG);	
				} catch(err) {
					console.log(error("Config File read error: " + configFileLocation + ", check your syntax, especially commas, then please try again."));
					console.log(err);
					process.exit(1);
				}
				summary.files.output.push(CONFIG.options.css_output);
				REPORT_DUPLICATE_CSS = CONFIG.options.report_file_location;
				CONFIG_REDUCE_DECLARATIONS = CONFIG.options.reduce_declarations_file_location;

				if (CONFIG.options.trim) {
					CONFIG.options.trim_removed_rules_previous_comment = CONFIG.options.trim;
					CONFIG.options.trim_comments = CONFIG.options.trim;
					CONFIG.options.trim_whitespace = CONFIG.options.trim;
					CONFIG.options.trim_breaklines = CONFIG.options.trim;
					CONFIG.options.trim_last_semicolon = CONFIG.options.trim;
				}
				if (CONFIG.options.shorten) {
					CONFIG.options.shorten_zero = CONFIG.options.shorten;
					CONFIG.options.shorten_hexcolor = CONFIG.options.shorten;
					CONFIG.options.shorten_hexcolor_extended_names = CONFIG.options.shorten;
					CONFIG.options.shorten_font = CONFIG.options.shorten;
					CONFIG.options.shorten_background = CONFIG.options.shorten;
					CONFIG.options.shorten_margin = CONFIG.options.shorten;
					CONFIG.options.shorten_padding = CONFIG.options.shorten;
					CONFIG.options.shorten_list_style = CONFIG.options.shorten;
					CONFIG.options.shorten_outline = CONFIG.options.shorten;
					CONFIG.options.shorten_border = CONFIG.options.shorten;
					CONFIG.options.shorten_border_top = CONFIG.options.shorten;
					CONFIG.options.shorten_border_right = CONFIG.options.shorten;
					CONFIG.options.shorten_border_bottom = CONFIG.options.shorten;
					CONFIG.options.shorten_border_left = CONFIG.options.shorten;
					CONFIG.options.shorten_border_radius = CONFIG.options.shorten;
				}
				OPTIONS = CONFIG.options;
				summary.options_used = OPTIONS;
			}

			CPEVENTS.emit('CONFIG_READ_END', OPTIONS);

		}).on('error', function(e) {
			CPEVENTS.emit('CONFIG_READ_ERROR');
			console.log(error("Config File read error: Something went wrong while reading the file, check your " + configFileLocation + " and please try again."));
			console.log(e);
			process.exit(1);

		});

		return readStream;
	}