Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9229209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:30:54+00:00 2026-06-18T05:30:54+00:00

I looked at the default Zip library that comes with the JDK and the

  • 0

I looked at the default Zip library that comes with the JDK and the Apache compression libs and I am unhappy with them for 3 reasons:

  1. They are bloated and have bad API design. I have to write 50 lines of boiler plate byte array output, zip input, file out streams and close relevant streams and catch exceptions and move byte buffers on my own? Why can’t I have a simple API that looks like this Zipper.unzip(InputStream zipFile, File targetDirectory, String password = null) and Zipper.zip(File targetDirectory, String password = null) that just works?

  2. It seems zipping unzipping destroys file meta-data and password handling is broken.

  3. Also, all the libraries I tried were 2-3x slow compared to the command line zip tools I get with UNIX?

For me (2) and (3) are minor points but I really want a good tested library with a one-line interface.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T05:30:55+00:00Added an answer on June 18, 2026 at 5:30 am

    I know its late and there are lots of answers but this zip4j is one of the best libraries for zipping I have used. Its simple (no boiler code) and can easily handle password protected files.

    import net.lingala.zip4j.exception.ZipException;
    import net.lingala.zip4j.core.ZipFile;
    
    
    public static void unzip(){
        String source = "some/compressed/file.zip";
        String destination = "some/destination/folder";
        String password = "password";
    
        try {
             ZipFile zipFile = new ZipFile(source);
             if (zipFile.isEncrypted()) {
                zipFile.setPassword(password);
             }
             zipFile.extractAll(destination);
        } catch (ZipException e) {
            e.printStackTrace();
        }
    }
    

    The Maven dependency is:

    <dependency>
        <groupId>net.lingala.zip4j</groupId>
        <artifactId>zip4j</artifactId>
        <version>1.3.2</version>
    </dependency>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've looked around, but can't specifically find my issue. I know that the default
I looked through some code and noticed that the convention was to turn pointer
I looked at this example http://msdn.microsoft.com/en-us/library/bb399420.aspx and clicked on DataContext.CreateDatabase which brought me to
I have looked at the Suggested related questions but none of them are what
What I am trying to do: It appears that by default when you use
What is the default order from a has_many relationship in Rails? Thought that in
They definitely looked OK a couple days ago, not sure what changed. Please check
I've looked on here and most say that its escape problems so I think
I'm attempting to build a database table that holds zip code data (that is
I have created an android project using eclipse.the default system generated code looked as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.