if (!filenames[i].endsWith(".jar"))
continue;
File file = new File(directory, filenames[i]);
try {
URL url = new URL("file", null, file.getCanonicalPath());
newLoader.addRepository(url.toString());
} catch (IOException e) {
throw new IllegalArgumentException(e.toString());
}
}
}