JarUtils { @Nonnull public static String resolveRelativePath(URL jarURL) throws NullPointerException, IllegalArgumentException { assertJarURLProtocol(jarURL); String form = jarURL.toExternalForm(); String relativePath = StringUtils.substringAfter(form, SeparatorConstants.ARCHIVE_ENTITY); relativePath = URLUtils.resolvePath(relativePath); return URLUtils.decode(relativePath); }  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 testResolveRelativePath() { URL resourceURL = ClassLoaderUtils.getClassResource(classLoader, String.class); String relativePath = JarUtils.resolveRelativePath(resourceURL); String expectedPath = "java/lang/String.class"; Assert.assertEquals(expectedPath, relativePath); }