get paid to paste

java-zip4j-tut-remove-zip-entry-3

import net.lingala.zip4j.ZipFile;
import net.lingala.zip4j.exception.ZipException;
import java.io.IOException;
import java.util.Arrays;

public class SampleClass{

  public static void main(String[] args)
                     throws ZipException,
                             IOException{
    ZipFile zip = null;
    
    try{
      zip = new ZipFile
      ("myzip.zip");
      zip.removeFiles(Arrays.asList(
      "img.jpg", "folder/img1.jpg",
      "folder/img2.jpg","folder/folderA/"));
    }
    finally{
      if(zip != null)
        zip.close();
    }
    
    System.out.println("main thread end.");
  }
}

Pasted: Nov 27, 2024, 9:36:31 am
Views: 6