JarWildcardStreamLocator extends DefaultWildcardStreamLocator { File getJarFile(final File folder) { return new File(StringUtils.substringAfter(StringUtils.substringBeforeLast(folder.getPath(), "!"), PREFIX_FILE)); }  @Override InputStream locateStream(final String uri, final File folder);  }
@Test public void shouldGetJarFileFromFile() { final String actual = jarStreamLocator.getJarFile(new File("file:path/to/file!one/two/three.class")).getPath(); final String expected = FilenameUtils.separatorsToSystem("path/to/file"); assertEquals(expected, actual); }