class ConfigUtil {

    private static final Logger LOG = Log.logger(ConfigUtil.class);

    private static final String NODE_GRAPHS = "graphs";
    private static final String CONF_SUFFIX = ".properties";
    private static final String CHARSET = "UTF-8";

    public static void checkGremlinConfig(String conf) {
        Parameters params = new Parameters();
        try {

            FileBasedConfigurationBuilder<FileBasedConfiguration> builder =
                    new FileBasedConfigurationBuilder(YAMLConfiguration.class)
                            .configure(params.fileBased().setFileName(conf));
            YAMLConfiguration config = (YAMLConfiguration) builder.getConfiguration();

            List<HierarchicalConfiguration<ImmutableNode>> nodes =
                    config.childConfigurationsAt(
                            NODE_GRAPHS);
            if (nodes == null || nodes.isEmpty()) {
                return;
            }
            E.checkArgument(nodes.size() == 1,
                            "Not allowed to specify multiple '%s' " +
                            "nodes in config file '%s'", NODE_GRAPHS, conf);

            ImmutableNode root = null;
            NodeHandler<ImmutableNode> nodeHandler = null;
            for (HierarchicalConfiguration<ImmutableNode> node : nodes) {
                NodeModel<ImmutableNode> nodeModel = node.getNodeModel();
                E.checkArgument(nodeModel != null &&
                                (nodeHandler = nodeModel.getNodeHandler()) != null &&
                                (root = nodeHandler.getRootNode()) != null,
                                "Node '%s' must contain root", node);
            }
        } catch (ConfigurationException e) {
            throw new HugeException("Failed to load yaml config file '%s'",
                                    conf);
        }
    }

    public static Map<String, String> scanGraphsDir(String graphsDirPath) {
        LOG.info("Scanning option 'graphs' directory '{}'", graphsDirPath);
        File graphsDir = new File(graphsDirPath);
        E.checkArgument(graphsDir.exists() && graphsDir.isDirectory(),
                        "Please ensure the path '%s' of option 'graphs' " +
                        "exist and it's a directory", graphsDir);
        File[] confFiles = graphsDir.listFiles((dir, name) -> {
            return name.endsWith(CONF_SUFFIX);
        });
        E.checkNotNull(confFiles, "graph configuration files");
        Map<String, String> graphConfs = InsertionOrderUtil.newMap();
        for (File confFile : confFiles) {
            // NOTE: use file name as graph name
            String name = StringUtils.substringBefore(confFile.getName(),
                                                      ConfigUtil.CONF_SUFFIX);
            HugeFactory.checkGraphName(name, confFile.getPath());
            graphConfs.put(name, confFile.getPath());
        }
        return graphConfs;
    }

    public static String writeToFile(String dir, String graphName,
                                     HugeConfig config) {
        File file = FileUtils.getFile(dir);
        E.checkArgument(file.exists(),
                        "The directory '%s' must exist", dir);
        String fileName = file.getPath() + File.separator + graphName + CONF_SUFFIX;
        try {
            File newFile = FileUtils.getFile(fileName);
            config.save(newFile);
            LOG.info("Write HugeConfig to file: '{}'", fileName);
        } catch (ConfigurationException e) {
            throw new HugeException("Failed to write HugeConfig to file '%s'",
                                    e, fileName);
        }

        return fileName;
    }

    public static void deleteFile(File file) {
        if (file == null || !file.exists()) {
            return;
        }
        try {
            FileUtils.forceDelete(file);
        } catch (IOException e) {
            throw new HugeException("Failed to delete HugeConfig file '%s'",
                                    e, file);
        }
    }

    public static PropertiesConfiguration buildConfig(String configText) {<FILL_FUNCTION_BODY>}
}

        E.checkArgument(StringUtils.isNotEmpty(configText),
                        "The config text can't be null or empty");
        PropertiesConfiguration propConfig = new PropertiesConfiguration();
        try {
            Reader in = new StringReader(configText);
            propConfig.read(in);
        } catch (Exception e) {
            throw new IllegalStateException("Failed to read config options", e);
        }
        return propConfig;
    
<no_super_class>