private static org.apache.commons.configuration2.Configuration getConfiguration(final File configurationFile) {
        if (!configurationFile.isFile())
            throw new IllegalArgumentException(String.format("The location configuration must resolve to a file and [%s] does not", configurationFile));

        try {
            final String fileName = configurationFile.getName();
            final String fileExtension = fileName.substring(fileName.lastIndexOf('.') + 1);

            final Configuration conf;
            final Configurations configs = new Configurations();

            switch (fileExtension) {
                case "yml":
                case "yaml":
                    final Parameters params = new Parameters();
                    final FileBasedConfigurationBuilder<FileBasedConfiguration> builder =
                            new FileBasedConfigurationBuilder<FileBasedConfiguration>(YAMLConfiguration.class).
                                    configure(params.fileBased().setFile(configurationFile));

                    final org.apache.commons.configuration2.Configuration copy = new org.apache.commons.configuration2.BaseConfiguration();
                    ConfigurationUtils.copy(builder.configure(params.fileBased().setFile(configurationFile)).getConfiguration(), copy);
                    conf = copy;
                    break;
                case "xml":
                    conf = configs.xml(configurationFile);
                    break;
                default:
                    conf = configs.properties(configurationFile);
            }
            return conf;
        } catch (ConfigurationException e) {
            throw new IllegalArgumentException(String.format("Could not load configuration at: %s", configurationFile), e);
        }
    }
Open a graph. See each {@link Graph} instance for its configuration options.

@param configuration A {@code Map} based configuration that will be converted to an
                     {@code Configuration} object via {@code MapConfiguration} and passed to the appropriate
                     overload.
@return A Graph instance.
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/GraphFactory.java