You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by pl...@apache.org on 2015/07/30 08:24:33 UTC

[26/50] [abbrv] directory-kerby git commit: DIRKRB-382 Promote kerby-config and kerby-util as top level modules, getting rid of lib

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6bb66073/lib/kerby-config/src/main/java/org/apache/kerby/config/Config.java
----------------------------------------------------------------------
diff --git a/lib/kerby-config/src/main/java/org/apache/kerby/config/Config.java b/lib/kerby-config/src/main/java/org/apache/kerby/config/Config.java
deleted file mode 100644
index 2eade15..0000000
--- a/lib/kerby-config/src/main/java/org/apache/kerby/config/Config.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/**
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *  
- *    http://www.apache.org/licenses/LICENSE-2.0
- *  
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License. 
- *  
- */
-package org.apache.kerby.config;
-
-import java.util.List;
-import java.util.Set;
-
-/**
- * Config API to get configuration properties from resources, like XML, Json,
- * ini, Java Properties and Map. It doesn't support writing back. It allows to
- * set configuration properties to ease the preparation of a Config.
- */
-public interface Config {
-    String getResource();
-    Set<String> getNames();
-
-    String getString(String name);
-    String getString(ConfigKey name);
-    String getString(String name, String defaultValue);
-
-    /**
-     * Set a string value for the specified property
-     * @param name
-     * @param value
-     */
-    void setString(String name, String value);
-
-    /**
-     * Set a string value for the specified property
-     * @param name
-     * @param value
-     */
-    void setString(ConfigKey name, String value);
-
-    String getTrimmed(String name);
-    String getTrimmed(ConfigKey name);
-    Boolean getBoolean(String name);
-    Boolean getBoolean(ConfigKey name);
-    Boolean getBoolean(String name, boolean defaultValue);
-
-    /**
-     * Set a boolean value for the specified property
-     * @param name
-     * @param value
-     */
-    void setBoolean(String name, boolean value);
-
-    /**
-     * Set a boolean value for the specified property
-     * @param name
-     * @param value
-     */
-    void setBoolean(ConfigKey name, boolean value);
-
-    Integer getInt(String name);
-    Integer getInt(ConfigKey name);
-    Integer getInt(String name, int defaultValue);
-
-    /**
-     * Set an int value for the specified property
-     * @param name
-     * @param value
-     */
-    void setInt(String name, int value);
-
-    /**
-     * Set an int value for the specified property
-     * @param name
-     * @param value
-     */
-    void setInt(ConfigKey name, int value);
-
-
-    Long getLong(String name);
-    Long getLong(ConfigKey name);
-    Long getLong(String name, long defaultValue);
-
-    /**
-     * Set a long value for the specified property
-     * @param name
-     * @param value
-     */
-    void setLong(String name, long value);
-
-    /**
-     * Set a long value for the specified property
-     * @param name
-     * @param value
-     */
-    void setLong(ConfigKey name, long value);
-
-    Float getFloat(String name);
-    Float getFloat(ConfigKey name);
-    Float getFloat(String name, float defaultValue);
-
-    /**
-     * Set a float value for the specified property
-     * @param name
-     * @param value
-     */
-    void setFloat(String name, float value);
-
-    /**
-     * Set a float value for the specified property
-     * @param name
-     * @param value
-     */
-    void setFloat(ConfigKey name, float value);
-
-    List<String> getList(String name);
-    List<String> getList(String name, String[] defaultValue);
-    List<String> getList(ConfigKey name);
-    Config getConfig(String name);
-    Config getConfig(ConfigKey name);
-
-    Class<?> getClass(String name) throws ClassNotFoundException;
-    Class<?> getClass(String name, Class<?> defaultValue) throws ClassNotFoundException;
-    Class<?> getClass(ConfigKey name) throws ClassNotFoundException;
-    <T> T getInstance(String name) throws ClassNotFoundException;
-    <T> T getInstance(ConfigKey name) throws ClassNotFoundException;
-    <T> T getInstance(String name, Class<T> xface) throws ClassNotFoundException;
-}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6bb66073/lib/kerby-config/src/main/java/org/apache/kerby/config/ConfigImpl.java
----------------------------------------------------------------------
diff --git a/lib/kerby-config/src/main/java/org/apache/kerby/config/ConfigImpl.java b/lib/kerby-config/src/main/java/org/apache/kerby/config/ConfigImpl.java
deleted file mode 100644
index e8a5b50..0000000
--- a/lib/kerby-config/src/main/java/org/apache/kerby/config/ConfigImpl.java
+++ /dev/null
@@ -1,422 +0,0 @@
-/**
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
-
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License. 
- *
- */
-package org.apache.kerby.config;
-
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-public class ConfigImpl implements Config {
-
-    private String resource;
-    private Map<String, ConfigObject> properties;
-    /**
-     * Config resources
-     */
-    private List<Config> configs;
-
-    private Set<String> propNames;
-
-    protected ConfigImpl(String resource) {
-        this.resource = resource;
-        this.properties = new HashMap<String, ConfigObject>();
-        this.configs = new ArrayList<Config>(0);
-    }
-
-    protected void reset() {
-        this.properties.clear();
-        this.configs.clear();
-    }
-
-    @Override
-    public String getResource() {
-        return resource;
-    }
-
-    @Override
-    public Set<String> getNames() {
-        reloadNames();
-        return propNames;
-    }
-
-    @Override
-    public String getString(String name) {
-        String result = null;
-
-        ConfigObject co = properties.get(name);
-        if (co != null) {
-            result = co.getPropertyValue();
-        } else {
-            for (Config config : configs) {
-                result = config.getString(name);
-                if (result != null) {
-                    break;
-                }
-            }
-        }
-
-        return result;
-    }
-
-    @Override
-    public String getString(ConfigKey name) {
-        if (name.getDefaultValue() != null) {
-            return getString(name.getPropertyKey(), (String) name.getDefaultValue());
-        }
-        return getString(name.getPropertyKey());
-    }
-
-    @Override
-    public String getString(String name, String defaultValue) {
-        String result = getString(name);
-        if (result == null) {
-            result = defaultValue;
-        }
-        return result;
-    }
-
-    @Override
-    public String getTrimmed(String name) {
-        String result = getString(name);
-        if (null != result) {
-            result = result.trim();
-        }
-        return result;
-    }
-
-    @Override
-    public String getTrimmed(ConfigKey name) {
-        return getTrimmed(name.getPropertyKey());
-    }
-
-    @Override
-    public Integer getInt(String name) {
-        Integer result = null;
-        String value = getTrimmed(name);
-        if (value != null) {
-            result = Integer.valueOf(value);
-        }
-        return result;
-    }
-
-    @Override
-    public Integer getInt(ConfigKey name) {
-        if (name.getDefaultValue() != null) {
-            return getInt(name.getPropertyKey(), (Integer) name.getDefaultValue());
-        }
-        return getInt(name.getPropertyKey());
-    }
-
-    @Override
-    public Integer getInt(String name, int defaultValue) {
-        Integer result = getInt(name);
-        if (result == null) {
-            result = defaultValue;
-        }
-        return result;
-    }
-
-    @Override
-    public void setInt(String name, int value) {
-        set(name, String.valueOf(value));
-    }
-
-    @Override
-    public void setInt(ConfigKey name, int value) {
-        set(name.getPropertyKey(), String.valueOf(value));
-    }
-
-    @Override
-    public Long getLong(String name) {
-        Long result = null;
-        String value = getTrimmed(name);
-        if (value != null) {
-            result = Long.valueOf(value);
-        }
-        return result;
-    }
-
-    @Override
-    public Long getLong(ConfigKey name) {
-        if (name.getDefaultValue() != null) {
-            return getLong(name.getPropertyKey(), (Long) name.getDefaultValue());
-        }
-        return getLong(name.getPropertyKey());
-    }
-
-    @Override
-    public Long getLong(String name, long defaultValue) {
-        Long result = getLong(name);
-        if (result == null) {
-            result = defaultValue;
-        }
-        return result;
-    }
-
-    @Override
-    public void setLong(String name, long value) {
-        set(name, String.valueOf(value));
-    }
-
-    @Override
-    public void setLong(ConfigKey name, long value) {
-        set(name.getPropertyKey(), String.valueOf(value));
-    }
-
-    @Override
-    public Float getFloat(String name) {
-        Float result = null;
-        String value = getTrimmed(name);
-        if (value != null) {
-            result = Float.valueOf(value);
-        }
-        return result;
-    }
-
-    @Override
-    public Float getFloat(ConfigKey name) {
-        if (name.getDefaultValue() != null) {
-            return getFloat(name.getPropertyKey(), (Float) name.getDefaultValue());
-        }
-        return getFloat(name.getPropertyKey());
-    }
-
-    @Override
-    public Float getFloat(String name, float defaultValue) {
-        Float result = getFloat(name);
-        if (result == null) {
-            result = defaultValue;
-        }
-        return result;
-    }
-
-    @Override
-    public void setFloat(String name, float value) {
-        set(name, String.valueOf(value));
-    }
-
-    @Override
-    public void setFloat(ConfigKey name, float value) {
-        set(name.getPropertyKey(), String.valueOf(value));
-    }
-
-    @Override
-    public Boolean getBoolean(String name) {
-        Boolean result = null;
-        String value = getTrimmed(name);
-        if (value != null) {
-            result = Boolean.valueOf(value);
-        }
-        return result;
-    }
-
-    @Override
-    public Boolean getBoolean(ConfigKey name) {
-        if (name.getDefaultValue() != null) {
-            return getBoolean(name.getPropertyKey(),
-                    (Boolean) name.getDefaultValue());
-        }
-        return getBoolean(name.getPropertyKey());
-    }
-
-    @Override
-    public Boolean getBoolean(String name, boolean defaultValue) {
-        Boolean result = getBoolean(name);
-        if (result == null) {
-            result = defaultValue;
-        }
-        return result;
-    }
-
-    @Override
-    public void setBoolean(String name, boolean value) {
-        set(name, String.valueOf(value));
-    }
-
-    @Override
-    public void setBoolean(ConfigKey name, boolean value) {
-        set(name.getPropertyKey(), String.valueOf(value));
-    }
-
-    @Override
-    public List<String> getList(String name) {
-        List<String> results = null;
-        ConfigObject co = properties.get(name);
-        if (co != null) {
-            results = co.getListValues();
-        } else {
-            for (Config config : configs) {
-                results = config.getList(name);
-                if (results != null) {
-                    break;
-                }
-            }
-        }
-        return results;
-    }
-
-    @Override
-    public List<String> getList(String name, String[] defaultValue) {
-        List<String> results = getList(name);
-        if (results == null) {
-            results = Arrays.asList(defaultValue);
-        }
-        return results;
-    }
-
-    @Override
-    public List<String> getList(ConfigKey name) {
-        if (name.getDefaultValue() != null) {
-            return getList(name.getPropertyKey(), (String[]) name.getDefaultValue());
-        }
-        return getList(name.getPropertyKey());
-    }
-
-    @Override
-    public Config getConfig(String name) {
-        Config result = null;
-        ConfigObject co = properties.get(name);
-        if (co != null) {
-            result = co.getConfigValue();
-        } else {
-            for (Config config : configs) {
-                result = config.getConfig(name);
-                if (result != null) {
-                    break;
-                }
-            }
-        }
-
-        return result;
-    }
-
-    @Override
-    public Config getConfig(ConfigKey name) {
-        return getConfig(name.getPropertyKey());
-    }
-
-    @Override
-    public Class<?> getClass(String name) throws ClassNotFoundException {
-        Class<?> result = null;
-
-        String valueString = getString(name);
-        if (valueString != null) {
-            Class<?> cls = Class.forName(name);
-            result = cls;
-        }
-
-        return result;
-    }
-
-    @Override
-    public Class<?> getClass(String name, Class<?> defaultValue) throws ClassNotFoundException {
-        Class<?> result = getClass(name);
-        if (result == null) {
-            result = defaultValue;
-        }
-        return result;
-    }
-
-    @Override
-    public Class<?> getClass(ConfigKey name) throws ClassNotFoundException {
-        if (name.getDefaultValue() != null) {
-            return getClass(name.getPropertyKey(), (Class<?>) name.getDefaultValue());
-        }
-        return getClass(name.getPropertyKey());
-    }
-
-    @Override
-    public <T> T getInstance(String name) throws ClassNotFoundException {
-        return getInstance(name, null);
-    }
-
-    @Override
-    public <T> T getInstance(ConfigKey name) throws ClassNotFoundException {
-        return getInstance(name.getPropertyKey());
-    }
-
-    @Override
-    public <T> T getInstance(String name, Class<T> xface) throws ClassNotFoundException {
-        T result = null;
-
-        Class<?> cls = getClass(name, null);
-        if (xface != null && !xface.isAssignableFrom(cls)) {
-            throw new RuntimeException(cls + " does not implement " + xface);
-        }
-        try {
-            result = (T) cls.newInstance();
-        } catch (Exception e) {
-            throw new RuntimeException("Failed to create instance with class " + cls.getName());
-        }
-
-        return result;
-    }
-
-
-    @Override
-    public void setString(String name, String value) {
-        set(name, value);
-    }
-
-    @Override
-    public void setString(ConfigKey name, String value) {
-        set(name.getPropertyKey(), value);
-    }
-
-    protected void set(String name, String value) {
-        ConfigObject co = new ConfigObject(value);
-        set(name, co);
-    }
-
-    protected void set(String name, Config value) {
-        ConfigObject co = new ConfigObject(value);
-        set(name, co);
-    }
-
-    protected void set(String name, ConfigObject value) {
-        this.properties.put(name, value);
-    }
-
-    protected void add(Config config) {
-        if (config != null) {
-            if (this == config) {
-                throw new IllegalArgumentException(
-                        "You can not add a config to itself");
-            }
-            this.configs.add(config);
-        }
-    }
-
-    private void reloadNames() {
-        if (propNames != null) {
-            propNames.clear();
-        }
-        propNames = new HashSet<String>(properties.keySet());
-        for (Config config : configs) {
-            propNames.addAll(config.getNames());
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6bb66073/lib/kerby-config/src/main/java/org/apache/kerby/config/ConfigKey.java
----------------------------------------------------------------------
diff --git a/lib/kerby-config/src/main/java/org/apache/kerby/config/ConfigKey.java b/lib/kerby-config/src/main/java/org/apache/kerby/config/ConfigKey.java
deleted file mode 100644
index 4424f22..0000000
--- a/lib/kerby-config/src/main/java/org/apache/kerby/config/ConfigKey.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *  
- *    http://www.apache.org/licenses/LICENSE-2.0
- *  
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License. 
- *  
- */
-package org.apache.kerby.config;
-
-public interface ConfigKey {
-    String getPropertyKey();
-    Object getDefaultValue();
-}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6bb66073/lib/kerby-config/src/main/java/org/apache/kerby/config/ConfigLoader.java
----------------------------------------------------------------------
diff --git a/lib/kerby-config/src/main/java/org/apache/kerby/config/ConfigLoader.java b/lib/kerby-config/src/main/java/org/apache/kerby/config/ConfigLoader.java
deleted file mode 100644
index 6282559..0000000
--- a/lib/kerby-config/src/main/java/org/apache/kerby/config/ConfigLoader.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *  
- *    http://www.apache.org/licenses/LICENSE-2.0
- *  
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License. 
- *  
- */
-package org.apache.kerby.config;
-
-public abstract class ConfigLoader {
-    private Resource resource;
-    private ConfigImpl config;
-
-    protected void setResource(Resource resource) {
-        this.resource = resource;
-    }
-
-    protected void setConfig(ConfigImpl config) {
-        this.config = config;
-    }
-
-    public Config load() {
-        if (config == null) {
-            config = new ConfigImpl(resource.getName());
-        }
-        config.reset();
-
-        try {
-            loadConfig(config, resource);
-        } catch (Exception e) {
-            throw new RuntimeException("Failed to load " + ConfigLoader.class.getPackage().getName(), e);
-        }
-
-        return this.config;
-    }
-
-    protected abstract void loadConfig(ConfigImpl config, Resource resource) throws Exception;
-}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6bb66073/lib/kerby-config/src/main/java/org/apache/kerby/config/ConfigObject.java
----------------------------------------------------------------------
diff --git a/lib/kerby-config/src/main/java/org/apache/kerby/config/ConfigObject.java b/lib/kerby-config/src/main/java/org/apache/kerby/config/ConfigObject.java
deleted file mode 100644
index 2be3972..0000000
--- a/lib/kerby-config/src/main/java/org/apache/kerby/config/ConfigObject.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/**
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *  
- *    http://www.apache.org/licenses/LICENSE-2.0
- *  
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License. 
- *  
- */
-package org.apache.kerby.config;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class ConfigObject {
-    protected static enum ValueType { PROPERTY, LIST, CONFIG };
-
-    private ValueType valueType;
-    private Object value;
-
-    public ConfigObject(String value) {
-        this.value = value;
-        this.valueType = ValueType.PROPERTY;
-    }
-
-    public ConfigObject(String[] values) {
-        List<String> valuesList = new ArrayList<String>();
-        for (String v : values) {
-            valuesList.add(v);
-        }
-
-        this.value = valuesList;
-        this.valueType = ValueType.LIST;
-    }
-
-    public ConfigObject(List<String> values) {
-        if (values != null) {
-            this.value = new ArrayList<String>(values);
-        } else {
-            this.value = new ArrayList<String>();
-        }
-        this.valueType = ValueType.LIST;
-    }
-
-    public ConfigObject(Config value) {
-        this.value = value;
-        this.valueType = ValueType.CONFIG;
-    }
-
-    public String getPropertyValue() {
-        String result = null;
-        if (valueType == ValueType.PROPERTY) {
-            result = (String) value;
-        }
-        return result;
-    }
-
-    @SuppressWarnings("unchecked")
-    public List<String> getListValues() {
-        List<String> results = null;
-        if (valueType == ValueType.LIST && value instanceof List<?>) {
-            results = (List<String>) value;
-        }
-
-        return results;
-    }
-
-    public Config getConfigValue() {
-        Config result = null;
-        if (valueType == ValueType.CONFIG) {
-            result = (Config) value;
-        }
-        return result;
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6bb66073/lib/kerby-config/src/main/java/org/apache/kerby/config/Configurable.java
----------------------------------------------------------------------
diff --git a/lib/kerby-config/src/main/java/org/apache/kerby/config/Configurable.java b/lib/kerby-config/src/main/java/org/apache/kerby/config/Configurable.java
deleted file mode 100644
index fd41dab..0000000
--- a/lib/kerby-config/src/main/java/org/apache/kerby/config/Configurable.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- *
- */
-package org.apache.kerby.config;
-
-/**
- * An interface for constructs that desire to be configurable thru the framework.
- */
-public interface Configurable {
-
-    void setConfig(Config config);
-
-    Config getConfig();
-}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6bb66073/lib/kerby-config/src/main/java/org/apache/kerby/config/Configured.java
----------------------------------------------------------------------
diff --git a/lib/kerby-config/src/main/java/org/apache/kerby/config/Configured.java b/lib/kerby-config/src/main/java/org/apache/kerby/config/Configured.java
deleted file mode 100644
index eadfb54..0000000
--- a/lib/kerby-config/src/main/java/org/apache/kerby/config/Configured.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- *
- */
-package org.apache.kerby.config;
-
-/**
- * An abstract for constructs that desire to be configurable.
- */
-public class Configured implements Configurable {
-    private Config config;
-
-    public Configured() {
-        config = null;
-    }
-
-    public Configured(Config config) {
-        this.config = config;
-    }
-
-    @Override
-    public Config getConfig() {
-        return config;
-    }
-
-    @Override
-    public void setConfig(Config config) {
-        this.config = config;
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6bb66073/lib/kerby-config/src/main/java/org/apache/kerby/config/IniConfigLoader.java
----------------------------------------------------------------------
diff --git a/lib/kerby-config/src/main/java/org/apache/kerby/config/IniConfigLoader.java b/lib/kerby-config/src/main/java/org/apache/kerby/config/IniConfigLoader.java
deleted file mode 100644
index 69e58ab..0000000
--- a/lib/kerby-config/src/main/java/org/apache/kerby/config/IniConfigLoader.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License. 
- *
- */
-package org.apache.kerby.config;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.nio.charset.Charset;
-
-public class IniConfigLoader extends ConfigLoader {
-    private static final String COMMENT_SYMBOL = "#";
-
-    private ConfigImpl rootConfig;
-    private ConfigImpl currentConfig;
-
-    /**
-     *  Load configs form the INI configuration format file.
-     */
-    @Override
-    protected void loadConfig(ConfigImpl config, Resource resource) throws IOException {
-        rootConfig = config;
-        currentConfig = config;
-
-        InputStream is = (InputStream) resource.getResource();
-        BufferedReader reader = new BufferedReader(new InputStreamReader(is, Charset.forName("UTF-8")));
-
-        String line;
-        while ((line = reader.readLine()) != null) {
-            parseLine(line);
-        }
-        reader.close();
-    }
-
-    private void parseLine(String line) {
-        if (line == null) {
-            return;
-        }
-        
-        line = line.trim();
-
-        if (line.startsWith(COMMENT_SYMBOL)) {
-            return;
-        }
-
-        if (line.matches("\\[.*\\]")) {
-            String subConfigName = line.replaceFirst("\\[(.*)\\]", "$1");
-            ConfigImpl subConfig = new ConfigImpl(subConfigName);
-            rootConfig.set(subConfigName, subConfig);
-            currentConfig = subConfig;
-        } else if (line.matches(".*=.*")) {
-            int i = line.indexOf('=');
-            String name = line.substring(0, i).trim();
-            String value = line.substring(i + 1).trim();
-            currentConfig.set(name, value);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6bb66073/lib/kerby-config/src/main/java/org/apache/kerby/config/JsonConfigLoader.java
----------------------------------------------------------------------
diff --git a/lib/kerby-config/src/main/java/org/apache/kerby/config/JsonConfigLoader.java b/lib/kerby-config/src/main/java/org/apache/kerby/config/JsonConfigLoader.java
deleted file mode 100644
index 5a51175..0000000
--- a/lib/kerby-config/src/main/java/org/apache/kerby/config/JsonConfigLoader.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *  
- *    http://www.apache.org/licenses/LICENSE-2.0
- *  
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License. 
- *  
- */
-package org.apache.kerby.config;
-
-public class JsonConfigLoader extends ConfigLoader {
-    @Override
-    protected void loadConfig(ConfigImpl config, Resource resource) {
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6bb66073/lib/kerby-config/src/main/java/org/apache/kerby/config/MapConfigLoader.java
----------------------------------------------------------------------
diff --git a/lib/kerby-config/src/main/java/org/apache/kerby/config/MapConfigLoader.java b/lib/kerby-config/src/main/java/org/apache/kerby/config/MapConfigLoader.java
deleted file mode 100644
index 9a212c3..0000000
--- a/lib/kerby-config/src/main/java/org/apache/kerby/config/MapConfigLoader.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *  
- *    http://www.apache.org/licenses/LICENSE-2.0
- *  
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License. 
- *  
- */
-package org.apache.kerby.config;
-
-import java.util.Map;
-
-public class MapConfigLoader extends ConfigLoader {
-    @Override
-    protected void loadConfig(ConfigImpl config, Resource resource) {
-        @SuppressWarnings("unchecked")
-        Map<String, String> mapConfig = (Map<String, String>) resource.getResource();
-        for (Map.Entry<String, String> entry : mapConfig.entrySet()) {
-            config.set(entry.getKey(), entry.getValue());
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6bb66073/lib/kerby-config/src/main/java/org/apache/kerby/config/PropertiesConfigLoader.java
----------------------------------------------------------------------
diff --git a/lib/kerby-config/src/main/java/org/apache/kerby/config/PropertiesConfigLoader.java b/lib/kerby-config/src/main/java/org/apache/kerby/config/PropertiesConfigLoader.java
deleted file mode 100644
index 58a04b9..0000000
--- a/lib/kerby-config/src/main/java/org/apache/kerby/config/PropertiesConfigLoader.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *  
- *    http://www.apache.org/licenses/LICENSE-2.0
- *  
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License. 
- *  
- */
-package org.apache.kerby.config;
-
-import java.util.Properties;
-
-public class PropertiesConfigLoader extends ConfigLoader {
-
-    @Override
-    protected void loadConfig(ConfigImpl config, Resource resource) throws Exception {
-        Properties propConfig = (Properties) resource.getResource();
-        loadConfig(config, propConfig);
-    }
-
-    protected void loadConfig(ConfigImpl config, Properties propConfig) {
-        for (Object key : propConfig.keySet()) {
-            if (key instanceof String) {
-                String value = propConfig.getProperty((String) key);
-                if (value != null) {
-                    config.set((String) key, value);
-                }
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6bb66073/lib/kerby-config/src/main/java/org/apache/kerby/config/PropertiesFileConfigLoader.java
----------------------------------------------------------------------
diff --git a/lib/kerby-config/src/main/java/org/apache/kerby/config/PropertiesFileConfigLoader.java b/lib/kerby-config/src/main/java/org/apache/kerby/config/PropertiesFileConfigLoader.java
deleted file mode 100644
index ba8660f..0000000
--- a/lib/kerby-config/src/main/java/org/apache/kerby/config/PropertiesFileConfigLoader.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *  
- *    http://www.apache.org/licenses/LICENSE-2.0
- *  
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License. 
- *  
- */
-package org.apache.kerby.config;
-
-import java.io.InputStream;
-import java.util.Properties;
-
-public class PropertiesFileConfigLoader extends PropertiesConfigLoader {
-
-    @Override
-    protected void loadConfig(ConfigImpl config, Resource resource) throws Exception {
-        Properties propConfig = new Properties();
-        propConfig.load((InputStream) resource.getResource());
-        loadConfig(config, propConfig);
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6bb66073/lib/kerby-config/src/main/java/org/apache/kerby/config/Resource.java
----------------------------------------------------------------------
diff --git a/lib/kerby-config/src/main/java/org/apache/kerby/config/Resource.java b/lib/kerby-config/src/main/java/org/apache/kerby/config/Resource.java
deleted file mode 100644
index 9988ffa..0000000
--- a/lib/kerby-config/src/main/java/org/apache/kerby/config/Resource.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/**
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *  
- *    http://www.apache.org/licenses/LICENSE-2.0
- *  
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License. 
- *  
- */
-package org.apache.kerby.config;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.net.URL;
-import java.util.Map;
-import java.util.Properties;
-
-public final class Resource {
-    public static enum Format {
-        XML_FILE(XmlConfigLoader.class),
-        INI_FILE(IniConfigLoader.class),
-        JSON_FILE(JsonConfigLoader.class),
-        PROPERTIES_FILE(PropertiesFileConfigLoader.class),
-        MAP(MapConfigLoader.class),
-        PROPERTIES(PropertiesConfigLoader.class);
-
-        private Class<? extends ConfigLoader> loaderClass;
-
-        private Format(Class<? extends ConfigLoader> loaderClass) {
-            this.loaderClass = loaderClass;
-        }
-
-        public Class<? extends ConfigLoader> getLoaderClass() {
-            return loaderClass;
-        }
-    }
-
-    private String name;
-    private Object resource;
-    private Format format;
-
-    public static Resource createXmlResource(File xmlFile) throws IOException {
-        return new Resource(xmlFile.getName(), xmlFile, Format.XML_FILE);
-    }
-
-    public static Resource createIniResource(File iniFile) throws IOException {
-        return new Resource(iniFile.getName(), iniFile, Format.INI_FILE);
-    }
-
-    public static Resource createJsonResource(File jsonFile) throws IOException {
-        return new Resource(jsonFile.getName(), jsonFile, Format.JSON_FILE);
-    }
-
-    public static Resource createXmlResource(URL xmlUrl) throws IOException {
-        return new Resource(xmlUrl, Format.XML_FILE);
-    }
-
-    public static Resource createIniResource(URL iniUrl) throws IOException {
-        return new Resource(iniUrl, Format.INI_FILE);
-    }
-
-    public static Resource createJsonResource(URL jsonUrl) throws IOException {
-        return new Resource(jsonUrl, Format.JSON_FILE);
-    }
-
-    public static Resource createMapResource(Map<String, String> mapConfig) {
-        return new Resource("mapConfig", mapConfig, Format.MAP);
-    }
-
-    public static Resource createPropertiesFileResource(File propFile) throws IOException {
-        return new Resource(propFile.getName(), propFile, Format.PROPERTIES_FILE);
-    }
-
-    public static Resource createPropertiesResource(Properties propertiesConfig) {
-        return new Resource("propConfig", propertiesConfig, Format.PROPERTIES);
-    }
-
-    private Resource(String name, File resourceFile, Format format) throws FileNotFoundException {
-        this.name = name;
-        this.resource = new FileInputStream(resourceFile);
-        this.format = format;
-    }
-
-    private Resource(URL resourceUrl, Format format) throws IOException {
-        this(resourceUrl.toString(), resourceUrl.openStream(), format);
-    }
-
-    private Resource(String name, Object resourceStream, Format format) {
-        this.name = name;
-        this.resource = resourceStream;
-        this.format = format;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public Object getResource() {
-        return resource;
-    }
-
-    public Format getFormat() {
-        return format;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6bb66073/lib/kerby-config/src/main/java/org/apache/kerby/config/XmlConfigLoader.java
----------------------------------------------------------------------
diff --git a/lib/kerby-config/src/main/java/org/apache/kerby/config/XmlConfigLoader.java b/lib/kerby-config/src/main/java/org/apache/kerby/config/XmlConfigLoader.java
deleted file mode 100644
index 2fd2f9c..0000000
--- a/lib/kerby-config/src/main/java/org/apache/kerby/config/XmlConfigLoader.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/**
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *  
- *    http://www.apache.org/licenses/LICENSE-2.0
- *  
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License. 
- *  
- */
-package org.apache.kerby.config;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-
-public class XmlConfigLoader extends ConfigLoader {
-    private static final Logger LOGGER = LoggerFactory.getLogger(Config.class);
-
-    @Override
-    protected void loadConfig(ConfigImpl config, Resource resource) throws Exception {
-        Element doc = loadResourceDocument(resource);
-        loadConfig(config, doc);
-    }
-
-    private Element loadResourceDocument(Resource resource) throws Exception {
-        DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
-
-        docBuilderFactory.setIgnoringComments(true);
-        docBuilderFactory.setNamespaceAware(true);
-        try {
-            docBuilderFactory.setXIncludeAware(true);
-        } catch (UnsupportedOperationException e) {
-            LOGGER.error("Failed to set setXIncludeAware(true) for parser", e);
-        }
-        DocumentBuilder builder = docBuilderFactory.newDocumentBuilder();
-        InputStream is = (InputStream) resource.getResource();
-        Document doc = null;
-        try {
-            doc = builder.parse(is);
-        } finally {
-            is.close();
-        }
-
-        Element root = doc.getDocumentElement();
-        validateConfig(root);
-
-        return root;
-    }
-
-    private boolean validateConfig(Element root) {
-        boolean valid = false;
-
-        if ("config".equals(root.getTagName())) {
-            valid = true;
-        } else {
-            LOGGER.error("bad conf element: top-level element not <configuration>");
-        }
-
-        return valid;
-    }
-
-    private void loadConfig(ConfigImpl config, Element element) {
-        NodeList props = element.getChildNodes();
-        for (int i = 0; i < props.getLength(); i++) {
-            Node subNode = props.item(i);
-            if (!(subNode instanceof Element)) {
-                continue;
-            }
-
-            Element prop = (Element) subNode;
-            String name = getElementName(prop);
-            if (name == null) {
-                continue;
-            }
-
-            ConfigObject value = null;
-            String tagName = prop.getTagName();
-            if ("property".equals(tagName) && prop.hasChildNodes()) {
-                value = loadProperty(prop);
-            } else if ("config".equals(tagName) && prop.hasChildNodes()) {
-                ConfigImpl cfg = new ConfigImpl(name);
-                loadConfig(cfg, prop);
-                value = new ConfigObject(cfg);
-            }
-                config.set(name, value);
-        }
-    }
-
-    private static ConfigObject loadProperty(Element ele) {
-        if (ele.getFirstChild() instanceof Text) {
-            String value = ((Text) ele.getFirstChild()).getData();
-            return new ConfigObject(value);
-        }
-
-        NodeList nodes = ele.getChildNodes();
-        List<String> values = new ArrayList<String>(nodes.getLength());
-        for (int i = 0; i < nodes.getLength(); i++) {
-            String value = null;
-            Node valueNode = nodes.item(i);
-            if (!(valueNode instanceof Element)) {
-                continue;
-            }
-
-            Element valueEle = (Element) valueNode;
-            if ("value".equals(valueEle.getTagName()) && valueEle.hasChildNodes()) {
-                value = ((Text) valueEle.getFirstChild()).getData();
-            }
-
-            if (value != null) {
-                values.add(value);
-            }
-        }
-        return new ConfigObject(values);
-    }
-
-    private static String getElementName(Element ele) {
-        NamedNodeMap nnm = ele.getAttributes();
-        for (int i = 0; i < nnm.getLength(); ++i) {
-            Node node = nnm.item(i);
-            if (!(node instanceof Attr)) {
-                continue;
-            }
-            Attr attr = (Attr) node;
-
-            if ("name".equals(attr.getName())) {
-                return attr.getValue();
-            }
-        }
-        return null;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6bb66073/lib/kerby-config/src/test/java/org/apache/kerby/config/ConfTest.java
----------------------------------------------------------------------
diff --git a/lib/kerby-config/src/test/java/org/apache/kerby/config/ConfTest.java b/lib/kerby-config/src/test/java/org/apache/kerby/config/ConfTest.java
deleted file mode 100644
index 185fe3f..0000000
--- a/lib/kerby-config/src/test/java/org/apache/kerby/config/ConfTest.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/**
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License. 
- *
- */
-package org.apache.kerby.config;
-
-import org.junit.Test;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-/**
- * The test is base on the Conf level.
- * We hope users use the Conf object only, and don't need to care about its internal implementation.
- */
-public class ConfTest {
-
-    @Test
-    public void testMapConfig() {
-        String strProp = "hello";
-        Integer intProp = 123456;
-        Boolean boolProp = true;
-        Map<String, String> mapConfig = new HashMap<String, String>();
-        mapConfig.put("strProp", strProp);
-        mapConfig.put("intProp", String.valueOf(intProp));
-        mapConfig.put("boolProp", String.valueOf(boolProp));
-
-        Conf conf = new Conf();
-        conf.addMapConfig(mapConfig);
-        assertThat(conf.getString("strProp")).isEqualTo(strProp);
-        assertThat(conf.getInt("intProp")).isEqualTo(intProp);
-        assertThat(conf.getBoolean("boolProp")).isEqualTo(boolProp);
-    }
-
-    @Test
-    public void testPropertiesConfig() {
-        String strProp = "hello";
-        Integer intProp = 123456;
-        Boolean boolProp = true;
-        Properties properties = new Properties();
-        properties.setProperty("strProp", strProp);
-        properties.setProperty("intProp", String.valueOf(intProp));
-        properties.setProperty("boolProp", String.valueOf(boolProp));
-
-        Conf conf = new Conf();
-        conf.addPropertiesConfig(properties);
-        assertThat(conf.getString("strProp")).isEqualTo(strProp);
-        assertThat(conf.getInt("intProp")).isEqualTo(intProp);
-        assertThat(conf.getBoolean("boolProp")).isEqualTo(boolProp);
-    }
-
-    /**
-     * Test for whether can get right value form the conf which contains many config resources.
-     */
-    @Test
-    public void testMixedConfig() {
-        String mapStrProp = "hello map";
-        Integer intProp = 123456;
-        Map<String, String> mapConfig = new HashMap<String, String>();
-        mapConfig.put("mapStrProp", mapStrProp);
-        mapConfig.put("intProp", String.valueOf(intProp));
-
-        String propertiesStrProp = "hello properties";
-        Boolean boolProp = true;
-        Properties properties = new Properties();
-        properties.setProperty("propertiesStrProp", propertiesStrProp);
-        properties.setProperty("boolProp", String.valueOf(boolProp));
-
-        Conf conf = new Conf();
-        conf.addMapConfig(mapConfig);
-        conf.addPropertiesConfig(properties);
-        assertThat(conf.getConfig("mapConfig")).isNull();
-        assertThat(conf.getString("mapStrProp")).isEqualTo(mapStrProp);
-        assertThat(conf.getString("propertiesStrProp")).isEqualTo(propertiesStrProp);
-        assertThat(conf.getInt("intProp")).isEqualTo(intProp);
-        assertThat(conf.getBoolean("boolProp")).isEqualTo(boolProp);
-    }
-
-    static enum TestConfKey implements ConfigKey {
-        ADDRESS("127.0.0.1"),
-        PORT(8015),
-        ENABLE(false);
-
-        private Object defaultValue;
-
-        private TestConfKey(Object defaultValue) {
-            this.defaultValue = defaultValue;
-        }
-
-        @Override
-        public String getPropertyKey() {
-            return name().toLowerCase();
-        }
-
-        @Override
-        public Object getDefaultValue() {
-            return this.defaultValue;
-        }
-    }
-
-    @Test
-    public void testConfKey() {
-        Conf conf = new Conf();
-        assertThat(conf.getString(TestConfKey.ADDRESS)).isEqualTo(TestConfKey.ADDRESS.getDefaultValue());
-        Map<String, String> mapConfig = new HashMap<String, String>();
-        String myAddress = "www.google.com";
-        mapConfig.put(TestConfKey.ADDRESS.getPropertyKey(), myAddress);
-        conf.addMapConfig(mapConfig);
-        assertThat(conf.getString(TestConfKey.ADDRESS)).isEqualTo(myAddress);
-        assertThat(conf.getInt(TestConfKey.PORT)).isEqualTo(TestConfKey.PORT.getDefaultValue());
-        assertThat(conf.getBoolean(TestConfKey.ENABLE)).isEqualTo(TestConfKey.ENABLE.getDefaultValue());
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6bb66073/lib/kerby-config/src/test/java/org/apache/kerby/config/ConfigImplTest.java
----------------------------------------------------------------------
diff --git a/lib/kerby-config/src/test/java/org/apache/kerby/config/ConfigImplTest.java b/lib/kerby-config/src/test/java/org/apache/kerby/config/ConfigImplTest.java
deleted file mode 100644
index f8c927f..0000000
--- a/lib/kerby-config/src/test/java/org/apache/kerby/config/ConfigImplTest.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- *
- */
-package org.apache.kerby.config;
-
-import org.junit.Test;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-/**
- * The test is on ConfigImpl level.
- * ConfigImpl is the internal implementation of Conf, only visual by developers.
- */
-public class ConfigImplTest {
-
-    /**
-     * Test for section config support.
-     */
-    @Test
-    public void testSectionConfig() {
-        ConfigImpl rootConfig = new ConfigImpl(null);
-        rootConfig.set("globalConfig", "true");
-
-        ConfigImpl sectionA = new ConfigImpl("libdefaults");
-        rootConfig.set("libdefaults", sectionA);
-        sectionA.set("default_realm", "EXAMPLE.COM");
-        sectionA.set("forwardable", "true");
-        sectionA.set("dns_lookup_realm", "false");
-
-        ConfigImpl sectionB = new ConfigImpl("logging");
-        rootConfig.set("logging", sectionB);
-        sectionB.set("kdc", "FILE:/var/log/krb5kdc.log");
-
-        assertThat(rootConfig.getString("globalConfig")).isEqualTo("true");
-        assertThat(rootConfig.getString("default_realm")).isNull(); //section config should not get the global value
-
-        Config subA = rootConfig.getConfig("libdefaults");
-        assertThat(subA.getString("default_realm")).isEqualTo("EXAMPLE.COM");
-        assertThat(subA.getString("globalConfig")).isNull();
-        assertThat(subA.getString("kdc")).isNull();
-
-        Config subB = rootConfig.getConfig("logging");
-        assertThat(subB.getString("kdc")).isEqualTo("FILE:/var/log/krb5kdc.log");
-        assertThat(subB.getString("globalConfig")).isNull();
-        assertThat(subB.getBoolean("forwardable")).isNull();
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6bb66073/lib/kerby-config/src/test/java/org/apache/kerby/config/IniConfigTest.java
----------------------------------------------------------------------
diff --git a/lib/kerby-config/src/test/java/org/apache/kerby/config/IniConfigTest.java b/lib/kerby-config/src/test/java/org/apache/kerby/config/IniConfigTest.java
deleted file mode 100644
index 4198560..0000000
--- a/lib/kerby-config/src/test/java/org/apache/kerby/config/IniConfigTest.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/**
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- *
- */
-package org.apache.kerby.config;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.PrintWriter;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class IniConfigTest {
-
-    private static final File TEST_DIR = new File(System.getProperty("test.dir", "target"));
-    private static final File TEST_FILE = new File(TEST_DIR, "test-ini-config");
-
-    @Before
-    public void setUp() throws IOException {
-        if (TEST_FILE.exists()) {
-            TEST_FILE.delete();
-        }
-        buildFile();
-    }
-
-    /**
-     * Build a INI format configuration file.
-     */
-    private void buildFile() throws IOException {
-        PrintWriter out = new PrintWriter(new FileWriter(TEST_FILE));
-        out.println("#note = notenote");
-        out.println("default = FILE:/var/log/krb5libs.log");
-        out.println("kdc = FILE:/var/log/krb5kdc.log");
-        out.println("admin_server = FILE:/var/log/kadmind.log");
-        out.println("[libdefaults]");
-        out.println("default_realm = EXAMPLE.COM");
-        out.println("dns_lookup_realm = false");
-        out.println("dns_lookup_kdc = false");
-        out.println("ticket_lifetime = 24h");
-        out.println("renew_lifetime = 7d");
-        out.println("forwardable = true");
-        out.println("[lib1]");
-        out.println("default_realm = EXAMPLE.COM1");
-        out.println("dns_lookup_realm = true");
-        out.close();
-    }
-
-    @Test
-    public void testIniConfig() throws IOException {
-        Conf conf = new Conf();
-        conf.addIniConfig(TEST_FILE);
-
-        assertThat(conf.getString("default")).isEqualTo("FILE:/var/log/krb5libs.log");
-        assertThat(conf.getString("#note")).isNull(); //Comments should be ignored when loading.
-
-        Config config = conf.getConfig("libdefaults");
-        assertThat(config.getBoolean("dns_lookup_realm")).isFalse();
-        assertThat(config.getBoolean("forwardable")).isTrue();
-
-        Config config1 = conf.getConfig("lib1");
-        assertThat(config1.getBoolean("dns_lookup_realm")).isTrue();
-    }
-
-    @After
-    public void tearDown() {
-        TEST_FILE.delete();
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6bb66073/lib/kerby-util/pom.xml
----------------------------------------------------------------------
diff --git a/lib/kerby-util/pom.xml b/lib/kerby-util/pom.xml
deleted file mode 100644
index b3ccb27..0000000
--- a/lib/kerby-util/pom.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License. See accompanying LICENSE file.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-
-  <parent>
-    <groupId>org.apache.kerby</groupId>
-    <artifactId>lib</artifactId>
-    <version>1.0-SNAPSHOT</version>
-  </parent>
-
-  <artifactId>kerby-util</artifactId>
-
-  <name>Kerby Util</name>
-  <description>Kerby common util, without any 3rd party dependency</description>
-
-</project>

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6bb66073/lib/kerby-util/src/main/java/org/apache/kerby/KOption.java
----------------------------------------------------------------------
diff --git a/lib/kerby-util/src/main/java/org/apache/kerby/KOption.java b/lib/kerby-util/src/main/java/org/apache/kerby/KOption.java
deleted file mode 100644
index 3809232..0000000
--- a/lib/kerby-util/src/main/java/org/apache/kerby/KOption.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *  
- *    http://www.apache.org/licenses/LICENSE-2.0
- *  
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License. 
- *  
- */
-package org.apache.kerby;
-
-public interface KOption {
-
-    void setType(KOptionType type);
-
-    KOptionType getType();
-
-    String getOptionName();
-
-    void setName(String name);
-
-    String getName();
-
-    void setDescription(String description);
-
-    String getDescription();
-
-    void setValue(Object value);
-
-    Object getValue();
-}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6bb66073/lib/kerby-util/src/main/java/org/apache/kerby/KOptionType.java
----------------------------------------------------------------------
diff --git a/lib/kerby-util/src/main/java/org/apache/kerby/KOptionType.java b/lib/kerby-util/src/main/java/org/apache/kerby/KOptionType.java
deleted file mode 100644
index d7e53b3..0000000
--- a/lib/kerby-util/src/main/java/org/apache/kerby/KOptionType.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *  
- *    http://www.apache.org/licenses/LICENSE-2.0
- *  
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License. 
- *  
- */
-package org.apache.kerby;
-
-/**
- * Option type.
- */
-public enum KOptionType {
-    NONE,
-    NOV, // no value, a control flag
-    STR, // string value
-    INT, // integer value
-    BOOL, // boolean value
-    FILE, // file path value
-    DIR, // dir path value
-    OBJ,  // arbitrary object
-    DATE // date value
-}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6bb66073/lib/kerby-util/src/main/java/org/apache/kerby/KOptions.java
----------------------------------------------------------------------
diff --git a/lib/kerby-util/src/main/java/org/apache/kerby/KOptions.java b/lib/kerby-util/src/main/java/org/apache/kerby/KOptions.java
deleted file mode 100644
index 0094610..0000000
--- a/lib/kerby-util/src/main/java/org/apache/kerby/KOptions.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/**
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *  
- *    http://www.apache.org/licenses/LICENSE-2.0
- *  
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License. 
- *  
- */
-package org.apache.kerby;
-
-import java.io.File;
-import java.text.DateFormat;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * A KOption container.
- */
-public class KOptions {
-
-    private final Map<KOption, KOption> options =
-            new HashMap<KOption, KOption>();
-
-    /**
-     * Parse string value according to kopt type.
-     * @param kopt
-     * @param strValue
-     * @return true when successful, false otherwise
-     */
-    public static boolean parseSetValue(KOption kopt, String strValue) {
-        KOptionType kt = kopt.getType();
-        if (kt == KOptionType.NOV) {
-            return true; // no need of a value
-        }
-        if (strValue == null || strValue.isEmpty()) {
-            return false;
-        }
-
-        if (kt == KOptionType.FILE) {
-            // May check file sanity
-            kopt.setValue(new File(strValue));
-        } else if (kt == KOptionType.DIR) {
-            File dir = new File(strValue);
-            if (!dir.exists()) {
-                throw new IllegalArgumentException("Invalid dir:" + strValue);
-            }
-            kopt.setValue(dir);
-        } else if (kt == KOptionType.INT) {
-            try {
-                Integer num = Integer.valueOf(strValue);
-                kopt.setValue(num);
-            } catch (NumberFormatException nfe) {
-                throw new IllegalArgumentException("Invalid integer:" + strValue);
-            }
-        } else if (kt == KOptionType.STR) {
-            kopt.setValue(strValue);
-        } else if (kt == KOptionType.DATE) {
-            DateFormat df = new SimpleDateFormat("dd/MM/yy:HH:mm:ss");
-            Date date = null;
-            try {
-                date = df.parse(strValue);
-                kopt.setValue(date);
-            } catch (ParseException e) {
-                throw new IllegalArgumentException("Fail to parse the date: " + strValue);
-            }
-        } else if (kt == KOptionType.BOOL) {
-            kopt.setValue(Boolean.valueOf(strValue));
-        } else {
-            throw new IllegalArgumentException("Not recognised option:" + strValue);
-        }
-        return true;
-    }
-
-    public void add(KOption option) {
-        if (option != null) {
-            options.put(option, option);
-        }
-    }
-
-    public void add(KOption option, Object optionValue) {
-        if (option != null) {
-            option.setValue(optionValue);
-            add(option);
-        }
-    }
-
-    public boolean contains(KOption option) {
-        return options.containsKey(option);
-    }
-
-    public List<KOption> getOptions() {
-        return new ArrayList<>(options.keySet());
-    }
-
-    public KOption getOption(KOption option) {
-        if (!options.containsKey(option)) {
-            return null;
-        }
-
-        return options.get(option);
-    }
-
-    public Object getOptionValue(KOption option) {
-        if (!contains(option)) {
-            return null;
-        }
-        return options.get(option).getValue();
-    }
-
-    public String getStringOption(KOption option) {
-        Object value = getOptionValue(option);
-        if (value instanceof String) {
-            return (String) value;
-        }
-        return null;
-    }
-
-    public boolean getBooleanOption(KOption option, Boolean defaultValue) {
-        Object value = getOptionValue(option);
-        if (value instanceof String) {
-            String strVal = (String) value;
-            if (strVal.equalsIgnoreCase("true")
-                    || strVal.equalsIgnoreCase("yes")
-                    || strVal.equals("1")) {
-                return true;
-            } else if (strVal.equalsIgnoreCase("false")
-                    || strVal.equalsIgnoreCase("no")
-                    || strVal.equals("0")) {
-                return false;
-            }
-        } else if (value instanceof Boolean) {
-            return (Boolean) value;
-        }
-
-        return defaultValue;
-    }
-
-    public int getIntegerOption(KOption option) {
-        Object value = getOptionValue(option);
-        if (value instanceof String) {
-            String strVal = (String) value;
-            return Integer.parseInt(strVal);
-        } else if (value instanceof Integer) {
-            return ((Integer) value).intValue();
-        }
-        return -1;
-    }
-
-    public File getFileOption(KOption option) {
-        Object value = getOptionValue(option);
-        if (value instanceof File) {
-            return (File) value;
-        }
-        return null;
-    }
-
-    public File getDirOption(KOption option) {
-        Object value = getOptionValue(option);
-        if (value instanceof File) {
-            return (File) value;
-        }
-        return null;
-    }
-
-    public Date getDateOption(KOption option) {
-        Object value = getOptionValue(option);
-        if (value instanceof Date) {
-            return (Date) value;
-        }
-        return null;
-    }
-}