JarUtils { @Nonnull public static String resolveJarAbsolutePath(URL jarURL) throws NullPointerException, IllegalArgumentException { assertJarURLProtocol(jarURL); File archiveFile = URLUtils.resolveArchiveFile(jarURL, FileSuffixConstants.JAR); return archiveFile == null ? null : archiveFile.getAbsolutePath(); }  static JarFile toJarFile(URL jarURL); @Nonnull static String resolveRelativePath(URL jarURL); @Nonnull static String resolveJarAbsolutePath(URL jarURL); @Nonnull static List<JarEntry> filter(JarFile jarFile, JarEntryFilter jarEntryFilter); static JarEntry findJarEntry(URL jarURL); static void extract(File jarSourceFile, File targetDirectory); static void extract(File jarSourceFile, File targetDirectory, JarEntryFilter jarEntryFilter); static void extract(JarFile jarFile, File targetDirectory, JarEntryFilter jarEntryFilter); static void extract(URL jarResourceURL, File targetDirectory, JarEntryFilter jarEntryFilter);  }
@Test public void testResolveJarAbsolutePath() throws Exception { URL resourceURL = ClassLoaderUtils.getClassResource(classLoader, String.class); String jarAbsolutePath = JarUtils.resolveJarAbsolutePath(resourceURL); File rtJarFile = new File(SystemUtils.JAVA_HOME, "/lib/rt.jar"); Assert.assertNotNull(jarAbsolutePath); Assert.assertEquals(rtJarFile.getAbsolutePath(), jarAbsolutePath); }