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 6553225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:33:24+00:00 2026-05-25T12:33:24+00:00

I have this code that’s supposed to unzipp a file. public class dec extends

  • 0

I have this code that’s supposed to unzipp a file.

public class dec extends Activity {

    @Override
        public void onCreate(Bundle savedInstanceState) {

            super.onCreate(savedInstanceState);

            Toast.makeText(this, "hello, starting to unZipp!", 15500).show();

            String location = Environment.getExternalStorageDirectory() + "/unzipped/"; 
            /////////////////////////////////////////////////////////////////////

            try  { 

                ZipInputStream zin = new ZipInputStream(getAssets().open("totalkeys.zip")); 

                ZipEntry ze = null; 

                while ((ze = zin.getNextEntry()) != null) { 
                  Log.v("Decompress", "My UNZIPPING: " + ze.getName()); 
                  if(ze.isDirectory()) { 
                    dirChecker(ze.getName()); 
                  } else { 
                    FileOutputStream fout = new FileOutputStream(location + ze.getName()); 
                    for (int c = zin.read(); c != -1; c = zin.read()) { 
                      fout.write(c); 
                    } 

                    zin.closeEntry(); 
                    fout.close(); 
                  } 

                } 
                zin.close(); 

              } catch(Exception e) { 
                Log.v("Decompress", "My ERROR: "+e.toString()); 
                /// throws My ERROR: java.io.FileNotFoundException: /mnt/sdcard/unzipped/Eng_blue/altlayout.txt (No such file or directory)
                /// and dies.
              } 
            } 

            ////////////////////////////////////////////////////

            private void dirChecker(String dir) { 

              String location = Environment.getExternalStorageDirectory() + "/unzipped/"; 
              File f = new File(location + dir); 

              if(!f.isDirectory()) { 
                f.mkdirs(); 
              } 

            ////////////////////////////////////////////////////

            finish();

    }

}

Yet it only throws “ava.io.FileNotFoundException: /mnt/sdcard/unzipped/Eng_blue/altlayout.txt” which is the name of the first file and dies.

I thought that dirChecker() method would create this folders on the flow… any ideas how to fix that?

Thanks!

  • 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-25T12:33:24+00:00Added an answer on May 25, 2026 at 12:33 pm

    Make sure you added the <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> permission to your AndroidManifest.xml file

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

Sidebar

Related Questions

I have this code that works. public class HelloWorldController : Controller { UAStagingEntities db
I have this code that saves a pdf file. FileStream fs = new FileStream(SaveLocation,
I have this code that is supposed to load the attributes of an XML
I have this code that adjusts the width of a comboBox drop-down: private void
I have this code that works from an .as file if (loaderInfo.loader) loaderInfo.loader.dispatchEvent(new Event(pageFinish,
I have this code that is supposed to take an array with some words,
I have this code that reads a file and creates Regex groups. Then I
I have this code that I want to insert a div clear class the
I have this code that is supposed to echo some values from a MySQL
I have this code that reads from marks.txt file. #include <iostream> #include <fstream> #include

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.