Lets say I have a file t.txt, a directory t and another file t/t2.txt. If I use the linux zip utility \"zip -r t.zip t.txt t\", I get a zip file with the following entries i
You can add "/" at the end of folder name. Just use the following command:
zip.putNextEntry(new ZipEntry("xml/"));