AntennaUtils { public static Iterator<Path> getJarPathIteratorFromPath(Path jarPath){ if (!jarPath.isAbsolute()){ throw new ExecutionException("This function should only be called with absolute paths"); } return new TillJarGroupingIterator(jarPath); } private  AntennaUtils(); static Iterator<Path> getJarPathIteratorFromPath(Path jarPath); static Path getJarPath(URL url); static Path getJarPath(Path jarPath); static String replaceDotInJarExtension(String path); static Path computeInnerReplacementJarPath(Path jarPath);  }
@Test public void getJarPathIteratorFromPathTest() { String filePath = "/some/path/to/file.jar/child.war/subChild.jar"; final Iterator<Path> iterator = AntennaUtils.getJarPathIteratorFromPath(Paths.get(filePath).toAbsolutePath()); Path val; assertThat(iterator.hasNext()).isTrue(); val = iterator.next(); assertThat(val).hasToString(toAbsolutePathname("/some/path/to/file.jar")); assertThat(iterator.hasNext()).isTrue(); val = iterator.next(); assertThat(val).hasToString(File.separator + "child.war"); assertThat(iterator.hasNext()).isTrue(); val = iterator.next(); assertThat(val).hasToString(File.separator + "subChild.jar"); assertThat(iterator.hasNext()).isFalse(); }