Attempts to load the given jar into the class path @param jar Full path to a .jar file @throws IOException if the file does not exist or cannot be accessed @throws SecurityException if there is a security manager present and the operation is denied @throws IllegalArgumentException if the filename di
(String jar)
| 166 | * @throws InvocationTargetException if there is an issue loading the jar |
| 167 | */ |
| 168 | public static void loadJAR(String jar) throws IOException, SecurityException, |
| 169 | IllegalArgumentException, NoSuchMethodException, IllegalAccessException, |
| 170 | InvocationTargetException { |
| 171 | if (!jar.toLowerCase().endsWith(".jar")) { |
| 172 | throw new IllegalArgumentException( |
| 173 | "File specified did not end with .jar"); |
| 174 | } |
| 175 | File file = new File(jar); |
| 176 | if (!file.exists()) { |
| 177 | throw new FileNotFoundException(jar); |
| 178 | } |
| 179 | addFile(file); |
| 180 | } |
| 181 | |
| 182 | /** |
| 183 | * Recursively traverses a directory searching for files ending with .jar and |