rep = new FileRepository(file);
if (!file.exists()) { throw new RuntimeException("Repository path does not exist: " + obj); } if (file.isDirectory()) { rep = new FileRepository(file); } else if (file.isFile()) { if (file.getName().endsWith(".js")) { rep = new SingleFileRepository(file); } else if (file.getName().endsWith(".zip")) { rep = new ZipRepository(file); } else { throw new RuntimeException("Unrecognized file type in addRepository: " + obj); } } else { throw new RuntimeException("Unrecognized file type in addRepository: " + obj); }
    public void addRepository(Object obj) {        Repository rep;        if (obj instanceof String) {            String path = (String) obj;            File file = new File(path).getAbsoluteFile();            if (!file.exists()) {                file = new File(path + ".zip").getAbsoluteFile();            }            if (!file.exists()) {                throw new RuntimeException("Repository path does not exist: " + file);            }            rep = new FileRepository(file);        } else if (obj instanceof Repository) {            rep = (Repository) obj;        } else {            throw new RuntimeException("Invalid argument to addRepository: " + obj);        }        app.addRepository(rep);    }