public static URL simplifyJarPath ( URL url ) { try { String segments [ ] = url . toString ( ) . split ( ".jar!/" ) ; String path = simplifyJarPath ( segments [ 1 ] ) ; return new URL ( segments [ 0 ] + ".jar!/" + path ) ; } catch ( IOException e ) { return url ; } }
Jar paths don t work if they include up directory . this wills trip those out .