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