I\'m using a class that I found through google to unzip a .zip file.. The .zip contains files and folder. The problem is that FileOutputStream
throws
Your first version relies on dirChecker(
) which you haven't posted, but either it doesn't work correctly, or your ZIP file doesn't contain directory entries at all, which is prefectly legal, so you shouldn't rely on them being present anyway.
Your second version is better but you don't need all this:
File f = new File(Path+FileName);
if(!f.exists())
{
f.mkdirs();
if(!f.createNewFile())
{
f.delete();
f.createNewFile();
}
}
You just need this:
File f = new File(Path, FileName);
f.getParentFile().mkdirs();
The rest will happen anyway.