private JarFile getJarFile(URL url) throws IOException { // Optimize case where url refers to a local jar file if (isOptimizable(url)) { FileURLMapper p = new FileURLMapper (url); if (!p.exists()) { throw new FileNotFoundException(p.getPath()); } return checkJar(new JarFile(p.getPath())); } URLConnection uc = getBaseURL().openConnection(); uc.setRequestProperty(USER_AGENT_JAVA_VERSION, JAVA_VERSION); JarFile jarFile = ((JarURLConnection)uc).getJarFile(); return checkJar(jarFile); }
private JarFile getJarFile(URL url) throws IOException { // Optimize case where url refers to a local jar file if (isOptimizable(url)) { FileURLMapper p = new FileURLMapper (url); if (!p.exists()) { throw new FileNotFoundException(p.getPath()); } return new JarFile (p.getPath()); } URLConnection uc = getBaseURL().openConnection(); uc.setRequestProperty(USER_AGENT_JAVA_VERSION, JAVA_VERSION); return ((JarURLConnection)uc).getJarFile(); }