privatebooleanunpackZip(String path,String zipname){InputStream is;ZipInputStream zis;try{String filename;
is =newFileInputStream(path + zipname);
zis =newZipInputStream(newBufferedInputStream(is));ZipEntry ze;byte[] buffer =newbyte[1024];int count;while((ze = zis.getNextEntry())!=null){// zapis do souboru
filename = ze.getName();// Need to create directories if not exists, or// it will generate an Exception...if(ze.isDirectory()){File fmd =newFile(path + filename);
fmd.mkdirs();continue;}FileOutputStream fout =newFileOutputStream(path + filename);// cteni zipu a zapiswhile((count = zis.read(buffer))!=-1){
fout.write(buffer,0, count);}
fout.close();
zis.closeEntry();}
zis.close();}catch(IOException e){
e.printStackTrace();returnfalse;}returntrue;}