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

  • Home
  • SEARCH
  • 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 3810264
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T15:26:00+00:00 2026-05-19T15:26:00+00:00

I want to unzip an iPhone app .ipa file. This is actually zip file

  • 0

I want to unzip an iPhone app .ipa file.
This is actually zip file that extracts normally.
But the actual app file in it is a folder with the ending .app ( as all mac applications are actually folders with the ending .app).
Now the period seems to be a problem for java.util.zip.

public static void main(String[] args) throws IOException {
    ZipFile zipFile = new ZipFile("file.zip");
    String path = "";

    Enumeration files = zipFile.entries();

    while (files.hasMoreElements()) {
        ZipEntry entry = (ZipEntry) files.nextElement();
        if (entry.isDirectory()) {
            File file = new File(path + entry.getName());
            file.mkdir();
            System.out.println("Create dir " + entry.getName());
        } else {
            File f = new File(entry.getName());
            FileOutputStream fos = new FileOutputStream(f); //EXception occurs here
            InputStream is = zipFile.getInputStream(entry);
            byte[] buffer = new byte[1024];
            int bytesRead = 0;
            while ((bytesRead = is.read(buffer)) != -1) {
                fos.write(buffer, 0, bytesRead);
            }
            fos.close();
            System.out.println("Create File " + entry.getName());
        }
    }
}

This is my output:

Exception in thread "main" java.io.FileNotFoundException: Payload/SMA Jobs.app/06-magnifying-glass.png (No such file or directory)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
    at Main.main(Main.java:27)
    enter code here

Anyone knows how to handle those periods?

  • 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-05-19T15:26:01+00:00Added an answer on May 19, 2026 at 3:26 pm

    First of all, you should use mkdirs(), not mkdir().

    second, zip files don’t always include all the directory entries (or have them in the right order). the best practice is to make the directories in both branches of the code, so add:

        } else {
            File f = new File(entry.getName());
            f.getParent().mkdirs();
    

    (you should add some checking to make sure getParent() is not null, etc).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one zip file that i want unzip .the size of this file
I want to unzip a file and this works fine system('unzip File.zip'); But I
I want to UnZip Zip File in my application for iPad. For make this
I want to unzip a zip file. I have the zip data as bytes.
I want to uncompress zipped file say, files.zip , to a directory that is
Basically, I have a jar file that i want to unzip to a specific
I want to unzip a zipped folder on my Redhat machine. To do this
I want to unzip a file that is splitted in parts (file.part1, file.part2, file.part3...).
I want to unzip a .zip file using VBScript, only it's always a new
I have the function below, but the problem is that the zip file will

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.