Create a new Configuration object. This object will have either the default
configuration or the configuration specified in {@link #PROPERTY_FILE}

@return The new Configuration object.
177877
public static Configuration createBasicConfiguration()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "createBasicConfiguration()");

        Configuration config = new Configuration();

        try
        {
            config.loadFromPropertyFile();
        }
        catch (IOException ioe)
        {
            //No FFDC Code Needed.
            config.datasourceClassname = "org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource";
            config.datasourceProperties.setProperty("databaseName",System.getProperty("js.test.dbname","msdb"));
            config.datasourceProperties.setProperty("createDatabase","create");
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "createBasicConfiguration()", config);

        return(config);
    }
867427
@Override
  public Configuration loadConfig() throws ConfigurationException, IOException {

    Configuration resultConfig = new Configuration();

    if (!Utils.localFileExists(this.getConfigFileName())) {
      // String configFileName = System.getenv(ConfigConstant.DDF_INI_ENV_VAR.getValue());
      File file = new File(this.locateConfigFileName(this.getConfigDir(), this.getConfigFileName()));
      mConfigDir = file.getParentFile().getName();
      mConfigFileName = file.getCanonicalPath();
    }

    if (!Utils.localFileExists(this.getConfigFileName())) return null;

    HierarchicalINIConfiguration config = new HierarchicalINIConfiguration(this.getConfigFileName());

    @SuppressWarnings("unchecked")
    Set<String> sectionNames = config.getSections();
    for (String sectionName : sectionNames) {
      SubnodeConfiguration section = config.getSection(sectionName);
      if (section != null) {
        Configuration.Section resultSection = resultConfig.getSection(sectionName);

        @SuppressWarnings("unchecked")
        Iterator<String> keys = section.getKeys();
        while (keys.hasNext()) {
          String key = keys.next();
          String value = section.getString(key);
          if (value != null) {
            resultSection.set(key, value);
          }
        }
      }
    }

    mConfig = resultConfig;
    return mConfig;
  }
52073
public ConfigPropertyType<AdminobjectType<T>> getOrCreateConfigProperty()
   {
      List<Node> nodeList = childNode.get("config-property");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new ConfigPropertyTypeImpl<AdminobjectType<T>>(this, "config-property", childNode, nodeList.get(0));
      }
      return createConfigProperty();
   }
468642
public static synchronized Properties getConfig() {
        if (config == null) {
            try {
                String rpcConfig = "config/rpc-config.properties";
                InputStream ins = SofaConfigs.class.getClassLoader().getResourceAsStream(rpcConfig);
                if (ins == null) {
                    ins = Thread.currentThread().getContextClassLoader()
                        .getResourceAsStream(rpcConfig);
                }

                config = new Properties();
                config.load(ins);
            } catch (Exception e) {
                config = new Properties();
                if (LOGGER.isDebugEnabled()) {
                    LOGGER.debug(LogCodes.getLog(LogCodes.ERROR_RPC_CONFIG_LOAD));
                }
            }
        }

        return config;
    }
1001604
@SuppressWarnings("unchecked")
  public static <T> T newInstance(Class<T> theClass, Configuration conf,
      boolean supportJobConf) {
    T result;
    try {
      Constructor<T> meth = (Constructor<T>) CONSTRUCTOR_CACHE.get(theClass);
      if (meth == null) {
        meth = theClass.getDeclaredConstructor(EMPTY_ARRAY);
        meth.setAccessible(true);
        CONSTRUCTOR_CACHE.put(theClass, meth);
      }
      result = meth.newInstance();
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
    setConf(result, conf, supportJobConf);
    return result;
  }
32150
@Nonnull
	public static Configuration createConfiguration(Properties properties) {
		final Configuration configuration = new Configuration();

		final Set<String> propertyNames = properties.stringPropertyNames();

		for (String propertyName : propertyNames) {
			configuration.setString(propertyName, properties.getProperty(propertyName));
		}

		return configuration;
	}
167396
public static DocFile createFileForInput(Configuration configuration, String file) {
        return DocFileFactory.getFactory(configuration).createFileForInput(file);
    }
224877
public Configuration getConfiguration() {
		final Configuration conf = new Configuration();
		for (Map.Entry<String, String> entry : data.entrySet()) {
			conf.setString(entry.getKey(), entry.getValue());
		}
		return conf;
	}
453083
public static CConfiguration create() {
    // Create a new configuration instance, but do NOT initialize with
    // the Hadoop default properties.
    CConfiguration conf = new CConfiguration();
    conf.addResource("tigon-default.xml");
    conf.addResource("tigon-site.xml");
    return conf;
  }
501830
public OptionsBuilder configurationFile(String configFile) {
		if (configFile != null) {
			options.put(Options.CONFIGURATION_FILE, new File(configFile));
		} else {
			options.remove(Options.CONFIGURATION_FILE);
		}
		return this;
	}
321432
def get_config_from_file(conf_properties_files):
        
        # Initialize the config object
        config = ExtendedConfigParser()
        logger = logging.getLogger(__name__)

        # Configure properties (last files could override properties)
        found = False
        files_list = conf_properties_files.split(';')
        for conf_properties_file in files_list:
            result = config.read(conf_properties_file)
            if len(result) == 0:
                message = 'Properties config file not found: %s'
                if len(files_list) == 1:
                    logger.error(message, conf_properties_file)
                    raise Exception(message % conf_properties_file)
                else:
                    logger.debug(message, conf_properties_file)
            else:
                logger.debug('Reading properties from file: %s', conf_properties_file)
                found = True
        if not found:
            message = 'Any of the properties config files has been found'
            logger.error(message)
            raise Exception(message)

        return config
911800
@RequestMapping(value = "configurations/create", method = RequestMethod.POST)
    public JIRAConfiguration newConfiguration(@RequestBody JIRAConfiguration configuration) {
        return jiraConfigurationService.newConfiguration(configuration);
    }
79089
public static Properties loadProperties(File file) throws IOException {
        FileInputStream finp = new FileInputStream(file);
        try {
            Properties p = new Properties();
            p.load(finp);
            return p;
        } finally {
            ArchiveUtils.closeQuietly(finp);
        }
    }
1299257
public static CacheConfiguration build(File file) throws IOException {
		ConfigMap<String, String> config = ConfigMap.load(file);
		return CacheConfiguration.build(config);
	}
914792
public static DefaultResourceConfig newApplicationConfig(UIContext context)
    {
        final Set<Object> singletons = getSingletons(context);
        final Set<Class<?>> classes = getClasses();

        return new DefaultResourceConfig()
        {
            @Override
            public Set<Class<?>> getClasses()
            {
                return classes;
            }

            @Override
            public Set<Object> getSingletons()
            {
                return singletons;
            }
        };
    }
99095
@VisibleForTesting
    public final Configuration getConfig(final File configFile) throws IOException {
        try (FileInputStream in = new FileInputStream(configFile)) {
            return getConfig(configFile, in);
        }
    }
950788
public static StoreConfig newInstance(File filePath) throws IOException {
        File homeDir;
        Properties p = new Properties();
        if(filePath.exists()) {
            if(filePath.isDirectory()) {
                homeDir = filePath;
                File propertiesFile = new File(filePath, CONFIG_PROPERTIES_FILE);
                if(propertiesFile.exists()) {
                    FileReader reader = new FileReader(propertiesFile);
                    p.load(reader);
                    reader.close();
                } else {
                    throw new FileNotFoundException(propertiesFile.toString());
                }
            } else {
                homeDir = filePath.getParentFile();
                FileReader reader = new FileReader(filePath);
                p.load(reader);
                reader.close();
            }
        } else {
            throw new FileNotFoundException(filePath.toString());
        }
        
        int initialCapacity = -1;
        String initialCapacityStr = p.getProperty(StoreParams.PARAM_INITIAL_CAPACITY);
        if(initialCapacityStr == null) {
            throw new InvalidStoreConfigException(StoreParams.PARAM_INITIAL_CAPACITY + " not found");
        } else if((initialCapacity = parseInt(StoreParams.PARAM_INITIAL_CAPACITY, initialCapacityStr, -1)) < 1) {
            throw new InvalidStoreConfigException(StoreParams.PARAM_INITIAL_CAPACITY + "=" + initialCapacityStr);
        }
        
        int partitionStart = -1;
        int partitionCount = -1;
        String partitionStartStr = p.getProperty(StoreParams.PARAM_PARTITION_START);
        String partitionCountStr = p.getProperty(StoreParams.PARAM_PARTITION_COUNT);
        if(partitionStartStr != null && partitionCountStr != null) {
            if((partitionStart = parseInt(StoreParams.PARAM_PARTITION_START, partitionStartStr, -1)) < 0) {
                throw new InvalidStoreConfigException(StoreParams.PARAM_PARTITION_START + "=" + partitionStartStr);
            }
            
            if((partitionCount = parseInt(StoreParams.PARAM_PARTITION_COUNT, partitionCountStr, -1)) < 1) {
                throw new InvalidStoreConfigException(StoreParams.PARAM_PARTITION_COUNT + "=" + partitionCountStr);
            }
        } else {
            return new StoreConfig(homeDir, initialCapacity);
        }
        
        return new StorePartitionConfig(homeDir, partitionStart, partitionCount);
    }