@Test public void getJarPathTestDoesWorkOnWinForwardSlashes() throws Exception { onlyForWindows(); final URL url = new URL("file: final Path jarPath = AntennaUtils.getJarPath(url); assertThat(jarPath).hasToString("C:\\Documents and Settings\\antenna\\someFile.jar"); }
public static Path getJarPath(URL url) throws URISyntaxException, MalformedURLException { if("jar".equals(url.getProtocol())) { String file = url.getFile(); if(file.contains("!")){ file = file.split("!",2)[0]; } url = new URL(file); } Path jarPath = Paths.get(url.toURI()); return getJarPath(jarPath); }
AntennaUtils { public static Path getJarPath(URL url) throws URISyntaxException, MalformedURLException { if("jar".equals(url.getProtocol())) { String file = url.getFile(); if(file.contains("!")){ file = file.split("!",2)[0]; } url = new URL(file); } Path jarPath = Paths.get(url.toURI()); return getJarPath(jarPath); } }
AntennaUtils { public static Path getJarPath(URL url) throws URISyntaxException, MalformedURLException { if("jar".equals(url.getProtocol())) { String file = url.getFile(); if(file.contains("!")){ file = file.split("!",2)[0]; } url = new URL(file); } Path jarPath = Paths.get(url.toURI()); return getJarPath(jarPath); } private  AntennaUtils(); }
AntennaUtils { public static Path getJarPath(URL url) throws URISyntaxException, MalformedURLException { if("jar".equals(url.getProtocol())) { String file = url.getFile(); if(file.contains("!")){ file = file.split("!",2)[0]; } url = new URL(file); } Path jarPath = Paths.get(url.toURI()); return getJarPath(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); }
AntennaUtils { public static Path getJarPath(URL url) throws URISyntaxException, MalformedURLException { if("jar".equals(url.getProtocol())) { String file = url.getFile(); if(file.contains("!")){ file = file.split("!",2)[0]; } url = new URL(file); } Path jarPath = Paths.get(url.toURI()); return getJarPath(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);  }