Skip to main content
added 302 characters in body
Source Link

it works for me

    ZipFile Vanilla = new ZipFile(new File("Vanilla.zip")); //zipfile defined and needs to be in directory
    Enumeration<? extends ZipEntry> entries = Vanilla.entries();// all (files)entries of zip file

    while(entries.hasMoreElements()){//runs while there is files in zip
        ZipEntry entry = entries.nextElement();
        //Stringgets nextrname =of file entries.nextElement();in zip
        File folderw =new File("tkwgter5834");//creates new directory
        InputStream stream = Vanilla.getInputStream(entry);//gets input
        FileInputStream inpure= new FileInputStream("Vanilla.zip");//file input stream for zip file to read bytes of file
        FileOutputStream outter = new FileOutputStream(new File(folderw +"//"+ entry.toString())); //fileoutput stream creates file inside defined directory(folderw variable) by file's name
        outter.write(inpure.readAllBytes());// write into files which were created 
        outter.close();//closes fileoutput stream
    }

it works for me

    ZipFile Vanilla = new ZipFile(new File("Vanilla.zip"));
    Enumeration<? extends ZipEntry> entries = Vanilla.entries();

    while(entries.hasMoreElements()){
        ZipEntry entry = entries.nextElement();
        //String nextr =  entries.nextElement();
        File folderw =new File("tkwgter5834");
        InputStream stream = Vanilla.getInputStream(entry);
        FileInputStream inpure= new FileInputStream("Vanilla.zip");
        FileOutputStream outter = new FileOutputStream(new File(folderw +"//"+ entry.toString()));
        outter.write(inpure.readAllBytes());
        outter.close();
    }

it works for me

    ZipFile Vanilla = new ZipFile(new File("Vanilla.zip")); //zipfile defined and needs to be in directory
    Enumeration<? extends ZipEntry> entries = Vanilla.entries();// all (files)entries of zip file

    while(entries.hasMoreElements()){//runs while there is files in zip
        ZipEntry entry = entries.nextElement();//gets name of file in zip
        File folderw =new File("tkwgter5834");//creates new directory
        InputStream stream = Vanilla.getInputStream(entry);//gets input
        FileInputStream inpure= new FileInputStream("Vanilla.zip");//file input stream for zip file to read bytes of file
        FileOutputStream outter = new FileOutputStream(new File(folderw +"//"+ entry.toString())); //fileoutput stream creates file inside defined directory(folderw variable) by file's name
        outter.write(inpure.readAllBytes());// write into files which were created 
        outter.close();//closes fileoutput stream
    }
Source Link

it works for me

    ZipFile Vanilla = new ZipFile(new File("Vanilla.zip"));
    Enumeration<? extends ZipEntry> entries = Vanilla.entries();

    while(entries.hasMoreElements()){
        ZipEntry entry = entries.nextElement();
        //String nextr =  entries.nextElement();
        File folderw =new File("tkwgter5834");
        InputStream stream = Vanilla.getInputStream(entry);
        FileInputStream inpure= new FileInputStream("Vanilla.zip");
        FileOutputStream outter = new FileOutputStream(new File(folderw +"//"+ entry.toString()));
        outter.write(inpure.readAllBytes());
        outter.close();
    }