@@ -0,0 +1,2512 @@
+package org.embulk.input.hdfs;%0A%0Aimport com.google.common.collect.ImmutableList;%0Aimport com.google.common.collect.ImmutableMap;%0Aimport com.google.common.collect.Lists;%0Aimport com.google.common.collect.Maps;%0Aimport org.apache.hadoop.conf.Configuration;%0Aimport org.embulk.config.ConfigException;%0Aimport org.embulk.spi.Exec;%0Aimport org.slf4j.Logger;%0A%0Aimport java.io.File;%0Aimport java.net.MalformedURLException;%0Aimport java.util.List;%0Aimport java.util.Map;%0A%0A/**%0A * Created by takahiro.nakayama on 2/22/16.%0A */%0Apublic class ConfigurationBuilder%0A%7B%0A    private static final Logger logger = Exec.getLogger(ConfigurationBuilder.class);%0A    private final ImmutableList.Builder%3CString%3E configFilesBuilder;%0A    private final ImmutableMap.Builder%3CString, String%3E configMapBuilder;%0A%0A    public ConfigurationBuilder()%0A    %7B%0A        this.configFilesBuilder = ImmutableList.builder();%0A        this.configMapBuilder = ImmutableMap.builder();%0A    %7D%0A%0A    public ConfigurationBuilder addConfigFiles(List%3CString%3E configFiles)%0A    %7B%0A        for (String configFile : configFiles) %7B%0A            addConfigFile(configFile);%0A        %7D%0A        return this;%0A    %7D%0A%0A    public ConfigurationBuilder addConfigFile(String configFile)%0A    %7B%0A        configFilesBuilder.add(configFile);%0A        return this;%0A    %7D%0A%0A    public ConfigurationBuilder addConfigMap(Map%3CString, String%3E configMap)%0A    %7B%0A        for (Map.Entry%3CString, String%3E entry : configMap.entrySet()) %7B%0A            addConfig(entry.getKey(), entry.getValue());%0A        %7D%0A        return this;%0A    %7D%0A%0A    public ConfigurationBuilder addConfig(String key, String value)%0A    %7B%0A        configMapBuilder.put(key, value);%0A        return this;%0A    %7D%0A%0A    public Configuration build()%0A    %7B%0A        Configuration configuration = new Configuration();%0A        for (String configFile : configFilesBuilder.build()) %7B%0A            File file = new File(configFile);%0A            try %7B%0A                configuration.addResource(file.toURI().toURL());%0A            %7D%0A            catch (MalformedURLException e) %7B%0A                throw new ConfigException(e);%0A            %7D%0A        %7D%0A        for (Map.Entry%3CString, String%3E entry : configMapBuilder.build().entrySet()) %7B%0A            configuration.set(entry.getKey(), entry.getValue());%0A        %7D%0A        // For debug%0A        for (Map.Entry%3CString, String%3E entry : configuration) %7B%0A            logger.trace(%22%7B%7D: %7B%7D%22, entry.getKey(), entry.getValue());%0A        %7D%0A        logger.trace(%22Resource Files: %7B%7D%22, configuration);%0A        return configuration;%0A    %7D%0A%7D%0A

Add ConfigurationBuilder