package atg.tools.ant.types;

import atg.tools.ant.util.ModuleUtils;
import org.apache.tools.ant.types.resources.FileResource;

import java.io.File;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author msicker
 * @version 2.0
 */
public class AtgInstallation
        extends FileResource {

    private final Map<String, Module> modules = new ConcurrentHashMap<String, Module>();

    /**
     * Sets the base ATG installation directory. For example, one might have ATG installed in
     * {@code $HOME/ATG/ATG11.0}, so you would use the following:
     * <pre>
     *     {@code <atg:atg id="atg.installation" home="${user.home}/ATG/ATG11.0"/>}
     * </pre>
     *
     * @param home
     *         directory where ATG is installed.
     */
    public void setHome(final File home) {
        setFile(home);
    }

    public File getHome() {
        return getFile();
    }

    protected Module getModule(final String name) {
        final Module cached = modules.get(name);
        if (cached != null) {
            return cached;
        }
        final Module module = new Module();
        module.setAtg(this);
        module.setModule(ModuleUtils.moduleNameToPath(name));
        modules.put(name, module);
        return module;
    }
}

@@ -27,47 +27,8 @@
 s;%0A%0A
-import atg.tools.ant.util.ModuleUtils;%0A
 impo
@@ -1133,43 +1133,13 @@
 ule(
-ModuleUtils.moduleNameToPath(
 name)
-)
 ;%0A  

Fix bug in module name.