private JarFile getRootJarFile(String name) throws IOException { try { if (!name.startsWith(FILE_PROTOCOL)) { throw new IllegalStateException("Not a file URL"); } String path = name.substring(FILE_PROTOCOL.length()); File file = new File(URLDecoder.decode(path, "UTF-8")); Map<File, JarFile> cache = rootFileCache.get(); JarFile result = (cache != null) ? cache.get(file) : null; if (result == null) { result = new JarFile(file); addToRootFileCache(file, result); } return result; } catch (Exception ex) { throw new IOException("Unable to open root Jar file '" + name + "'", ex); } }