Code example for JarURLConnection

Methods: connect, getJarFile, setUseCaches

0
     
    public JarURLResource(String jarUrl) {
        this.jarUrl = jarUrl;
    } 
     
    @Override 
    public JarFile getJarFile() throws IOException {
        URL jarFileUrl = new URL("jar:" + jarUrl + "!/");
        JarURLConnection conn = (JarURLConnection) jarFileUrl.openConnection();
        conn.setUseCaches(false);
        conn.connect();
        return conn.getJarFile();
    } 
        
    @Override 
    public String getUrl() {
        return jarUrl;
    } 
     
    @Override 
    public URL getEntry(String name) {