@@ -0,0 +1,1625 @@
+package org.embulk.input.hdfs;%0A%0Aimport org.apache.hadoop.conf.Configuration;%0Aimport org.embulk.config.Config;%0Aimport org.embulk.config.ConfigDefault;%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%0Apublic class ConfigurationFactory%0A%7B%0A    public static final Logger logger = Exec.getLogger(ConfigurationFactory.class);%0A%0A    interface Task%0A    %7B%0A        @Config(%22config_files%22)%0A        @ConfigDefault(%22%5B%5D%22)%0A        List%3CString%3E getConfigFiles();%0A%0A        @Config(%22config%22)%0A        @ConfigDefault(%22%7B%7D%22)%0A        Map%3CString, String%3E getConfig();%0A    %7D%0A%0A    private ConfigurationFactory()%0A    %7B%0A    %7D%0A%0A    public static Configuration create(Task task)%0A    %7B%0A        Configuration c = new Configuration();%0A        for (String f : task.getConfigFiles()) %7B%0A            try %7B%0A                logger.debug(%22load a config file: %7B%7D%22, f);%0A                c.addResource(new File(f).toURI().toURL());%0A            %7D%0A            catch (MalformedURLException e) %7B%0A                throw new ConfigException(e);%0A            %7D%0A        %7D%0A%0A        for (Map.Entry%3CString, String%3E entry : task.getConfig().entrySet()) %7B%0A            logger.debug(%22load a config: %7B%7D:%7B%7D%22, entry.getKey(), entry.getValue());%0A            c.set(entry.getKey(), entry.getValue());%0A        %7D%0A%0A        // For logging%0A        for (Map.Entry%3CString, String%3E entry : c) %7B%0A            logger.trace(%22%7B%7D: %7B%7D%22, entry.getKey(), entry.getValue());%0A        %7D%0A        logger.trace(%22Resource Files: %7B%7D%22, c);%0A%0A        return c;%0A    %7D%0A%7D%0A

Create ConfigurationFactory