Code example for JarOutputStream

Methods: putNextEntryclosecloseEntry

0
     * Regression test for HARMONY-29 
     */ 
	public void test_getJarFile29() throws Exception { 
        File jarFile = File.createTempFile("1+2 3", "test.jar");
        jarFile.deleteOnExit();
        JarOutputStream out = new JarOutputStream(new FileOutputStream(jarFile));
        out.putNextEntry(new ZipEntry("test"));
        out.closeEntry();
        out.close();
 
        JarURLConnection conn = (JarURLConnection) new URL("jar:file:"
                + jarFile.getAbsolutePath().replaceAll(" ", "%20") + "!/")
                .openConnection();
        conn.getJarFile().entries();
    } 
     
    //Regression for HARMONY-3436 
    public void test_setUseCaches() throws Exception { 
        File resources = Support_Resources.createTempFolder();
        Support_Resources.copyFile(resources, null, "hyts_att.jar");
Connect your IDE to all the code out there  Get Codota for Java