    001package cpw.mods.fml.common.discovery;
    002
    003import java.util.List;
    004
    005import com.google.common.base.Throwables;
    006
    007import cpw.mods.fml.common.ModContainer;
    008
    009public enum ContainerType
    010{
    011    JAR(JarDiscoverer.class),
    012    DIR(DirectoryDiscoverer.class);
    013
    014    private ITypeDiscoverer discoverer;
    015
    016    private ContainerType(Class<? extends ITypeDiscoverer> discovererClass)
    017    {
    018        try
    019        {
    020            this.discoverer = discovererClass.newInstance();
    021        }
    022        catch (Exception e)
    023        {
    024            throw Throwables.propagate(e);
    025        }
    026    }
    027
    028    public List<ModContainer> findMods(ModCandidate candidate, ASMDataTable table)
    029    {
    030        return discoverer.discover(candidate, table);
    031    }
    032}