/** * Add all the jar files in a dir to the classpath, represented as a Vector * of URLs. */ @SuppressWarnings("unchecked") public static void addToClassPath(Vector<URL> cpV, String dir) { try { String cpComp[] = getFilesByExt(dir, ".jar"); if (cpComp != null) { int jarCount = cpComp.length; for (int i = 0; i < jarCount; i++) { URL url = getURL(dir, cpComp[i]); if (url != null) cpV.addElement(url); } } } catch (Exception ex) { logger.debug("failed to add urls to classpath", ex); } }
/** * Add all the jar files in a dir to the classpath, represented as a Vector * of URLs. */ @SuppressWarnings("unchecked") public static void addToClassPath(Vector<URL> cpV, String dir) { try { String cpComp[] = getFilesByExt(dir, ".jar"); if (cpComp != null) { int jarCount = cpComp.length; for (int i = 0; i < jarCount; i++) { URL url = getURL(dir, cpComp[i]); if (url != null) cpV.addElement(url); } } } catch (Exception ex) { ex.printStackTrace(); } }