Returns a reference to the H2 database file.

@param configuration the configured settings
@return the path to the H2 database file
@throws IOException thrown if there is an error
507927
public static File getH2DataFile(Settings configuration) throws IOException {
        final File dir = configuration.getH2DataDirectory();
        final String fileName = configuration.getString(Settings.KEYS.DB_FILE_NAME);
        final File file = new File(dir, fileName);
        return file;
    }
535050
public File pathToFile( String fileName )
        throws IOException
    {
        String cwd = (String)getu("bsh.cwd");
        File file = new File( fileName );

        // if relative, fix up to bsh.cwd
        if ( !file.isAbsolute() ) {
            file = new File( cwd + File.separator + fileName );
        }

        return new File( file.getCanonicalPath() );
    }
1150725
public static long getTimestamp(Configuration conf, URI cache)
    throws IOException {
    FileSystem fileSystem = FileSystem.get(cache, conf);
    Path filePath = new Path(cache.getPath());

    return fileSystem.getFileStatus(filePath).getModificationTime();
  }
939326
private static Path locateFileInCache(Configuration conf, String filename) throws IOException {
    return new Path(getInstancesFolder(FileSystem.get(conf), conf), filename);
  }
932321
def get_config_file():
    # type: () -> AnyStr
    """"""
    parser = argparse.ArgumentParser(description="Read configuration file.")
    parser.add_argument('-ini', help="Full path of configuration file")
    args = parser.parse_args()
    ini_file = args.ini
    if not FileClass.is_file_exists(ini_file):
        print("Usage: -ini <full path to the configuration file.>")
        exit(-1)
    return ini_file
663333
protected void loadConfig(final String file) throws FileNotFoundException,
      IOException {
    final FileInputStream file_stream = new FileInputStream(file);
    try {
      final Properties props = new Properties();
      props.load(file_stream);

      // load the hash map
      loadHashMap(props);

      // no exceptions thrown, so save the valid path and exit
      LOG.info("Successfully loaded configuration file: " + file);
      config_location = file;
    } finally {
      file_stream.close();
    }
  }
626028
public String resolve( Map<String, String> configuration )
    {
        StringBuilder buffer = new StringBuilder();
        append( buffer, configuration, null );
        return buffer.toString();
    }
771431
public MigrationConfiguration getMigrationConfiguration(String configurationName)
            throws IOException, LightblueException {
        DataFindRequest findRequest = new DataFindRequest("migrationConfiguration", null);
        findRequest.where(Query.and(
                Query.withValue("configurationName", Query.eq, configurationName),
                Query.withValue("consistencyCheckerName", Query.eq, cfg.getName()))
        );
        findRequest.select(Projection.includeFieldRecursively("*"));
        LOGGER.debug("Loading configuration:{}", findRequest.getBody());
        return lightblueClient.data(findRequest, MigrationConfiguration.class);
    }
213007
public static DocFile createFileForDirectory(Configuration configuration, String file) {
        return DocFileFactory.getFactory(configuration).createFileForDirectory(file);
    }
877708
Iterator<FileSet<CopyEntity>> getCopyEntities(CopyConfiguration configuration) throws IOException {
    return getCopyEntities(configuration, null, null);
  }
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;
  }
1110798
public static String getConfigLocation() {
        if (configLocation == null) {
            String configLoc = System.getProperty(MDW_CONFIG_LOCATION);
            if (configLoc != null) {
                if (!configLoc.endsWith("/"))
                    configLoc = configLoc + "/";
                configLocation = configLoc;
                System.out.println("Loading configuration files from '" + new File(configLoc).getAbsolutePath() + "'");
            }
        }
        return configLocation;
    }
535048
private static Map<String, String> loadDatabaseConfig(
			final Configuration config) {
		// create database configuration
		final Map<String, String> databaseConfig = new HashMap<String, String>();

		// fill database configuration
		databaseConfig.put("cache_type", config.getCacheType());
		databaseConfig.put("use_memory_mapped_buffers",
				config.getUseMemoryMappedBuffers());

		return databaseConfig;
	}
1063276
protected static InputStream getConfigurationFileFromAssets(Context context,
            String fileName) {
        if (context == null) {
            return null;
        }

        AssetManager assets = context.getAssets();
        if (assets == null) {
            return null;
        }

        try {
            return assets.open(fileName);
        } catch (IOException e) {
            return null;
        }

    }
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);
  }
493919
static Path getEnvironemtVariableConfigFilePath() {
        final String value = System.getenv(ENVIRONMENT_CONFIG_VARIABLE_NAME);
        return Paths.get(value);
    }
99095
@VisibleForTesting
    public final Configuration getConfig(final File configFile) throws IOException {
        try (FileInputStream in = new FileInputStream(configFile)) {
            return getConfig(configFile, in);
        }
    }