public SynchronizationResponse writeZip(InputStream in, String resEntry)
throws IOException, ClassNotFoundException {
SynchronizationResponse response = null;
ZipInputStream zin = null;
CheckedInputStream cis = null;
ZipEntry entry = null;
ObjectInputStream oin = null;
try {
cis = new CheckedInputStream(in, new CRC32());
zin = new ZipInputStream(cis);
entry = zin.getNextEntry();
while (entry != null) {
String eName = entry.getName();
if (isIgnoredEntry(eName)) {
// do nothing, skip this entry
} else if (ServletProcessor.RESPONSE_ENTRY_NAME.equals(eName)) {
oin = new ObjectInputStream(zin);
response = (SynchronizationResponse) oin.readObject();
} else {
writeZipEntry(entry, zin);
}
// next entry
zin.closeEntry();
entry = zin.getNextEntry();
}
zin.close();
zin = null;
return response;
} finally {
if (cis != null) {
try { cis.close(); } catch (Exception ex) { }
}
if (zin != null) {
try { zin.close(); } catch (Exception ex) { }
}
if (oin != null) {