1. import net.lingala.zip4j.ZipFile;
  2. import net.lingala.zip4j.exception.ZipException;
  3. import java.io.IOException;
  4. import java.util.Arrays;
  5. public class SampleClass{
  6. public static void main(String[] args)
  7. throws ZipException,
  8. IOException{
  9. ZipFile zip = null;
  10. try{
  11. zip = new ZipFile
  12. ("myzip.zip");
  13. zip.removeFiles(Arrays.asList(
  14. "img.jpg", "folder/img1.jpg",
  15. "folder/img2.jpg","folder/folderA/"));
  16. }
  17. finally{
  18. if(zip != null)
  19. zip.close();
  20. }
  21. System.out.println("main thread end.");
  22. }
  23. }