    001    package cpw.mods.fml.common.discovery;
    002
    003    import java.util.List;
    004
    005    import com.google.common.base.Throwables;
    006
    007    import cpw.mods.fml.common.ModContainer;
    008
    009    public 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    }