MCPcopy Create free account
hub / github.com/OpenTSDB/opentsdb / addURL

Method addURL

src/utils/PluginLoader.java:275–285  ·  view source on GitHub ↗

Attempts to add the given file/URL to the class loader @param url Full path to the file to add @throws SecurityException if there is a security manager present and the operation is denied @throws IllegalArgumentException if the path was not a directory @throws NoSuchMethodException if there is an er

(final URL url)

Source from the content-addressed store, hash-verified

273 * @throws InvocationTargetException if there is an issue loading the jar
274 */
275 private static void addURL(final URL url) throws SecurityException,
276 NoSuchMethodException, IllegalArgumentException, IllegalAccessException,
277 InvocationTargetException {
278 URLClassLoader sysloader = (URLClassLoader)ClassLoader.getSystemClassLoader();
279 Class<?> sysclass = URLClassLoader.class;
280
281 Method method = sysclass.getDeclaredMethod("addURL", PARAMETER_TYPES);
282 method.setAccessible(true);
283 method.invoke(sysloader, new Object[]{ url });
284 LOG.debug("Successfully added JAR to class loader: " + url.getFile());
285 }
286}

Callers 1

addFileMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected