f.mkdir();
log.debug("##### WRITE FILE TO: " + completeName);
ZipInputStream zipinputstream = new ZipInputStream(is);
byte[] buf = new byte[1024];
ZipEntry zipentry = zipinputstream.getNextEntry();
while (zipentry != null) {
//for each entry to be extracted
String entryName = completeName + File.separatorChar + zipentry.getName();
entryName = entryName.replace('/', File.separatorChar);
entryName = entryName.replace('\\', File.separatorChar);
//log.debug("entryname " + entryName);
//zipentry.get
int n;
FileOutputStream fileoutputstream;
File newFile = new File(entryName);
if (zipentry.isDirectory()) {
if (!newFile.mkdir()) {
break;
}
zipentry = zipinputstream.getNextEntry();
continue;
}
File fentryName = new File(entryName);
File fparent = new File(fentryName.getParent());
if (!fparent.exists()) {
File fparentparent = new File(fparent.getParent());
if (!fparentparent.exists()) {
File fparentparentparent = new File(fparentparent.getParent());
if (!fparentparentparent.exists()) {
fparentparentparent.mkdir();
fparentparent.mkdir();
fparent.mkdir();
} else {
fparentparent.mkdir();
fparent.mkdir();
}
} else {
fparent.mkdir();
}
}
fileoutputstream = new FileOutputStream(entryName);
while ((n = zipinputstream.read(buf, 0, 1024)) > -1) {
fileoutputstream.write(buf, 0, n);
}
fileoutputstream.close();
zipinputstream.closeEntry();
zipentry = zipinputstream.getNextEntry();
}//while
zipinputstream.close();
/* #####################
* Import Organizations
*/