Skip to content

Commit

Permalink
0001488: also handle the case when delete and create are captured in …
Browse files Browse the repository at this point in the history
…the same batch
  • Loading branch information
chenson42 committed Dec 14, 2013
1 parent 6d72d35 commit 989e8c5
Showing 1 changed file with 20 additions and 18 deletions.
Expand Up @@ -292,26 +292,28 @@ public void end(Batch batch, boolean inError) {


if (process) {
if (file.exists()) {
byteCount += file.length();
ZipEntry entry = new ZipEntry(entryName.toString());
entry.setSize(file.length());
entry.setTime(file.lastModified());
zos.putNextEntry(entry);
if (file.isFile()) {
FileInputStream fis = new FileInputStream(file);
try {
IOUtils.copy(fis, zos);
} finally {
IOUtils.closeQuietly(fis);
if (eventType != LastEventType.DELETE) {
if (file.exists()) {
byteCount += file.length();
ZipEntry entry = new ZipEntry(entryName.toString());
entry.setSize(file.length());
entry.setTime(file.lastModified());
zos.putNextEntry(entry);
if (file.isFile()) {
FileInputStream fis = new FileInputStream(file);
try {
IOUtils.copy(fis, zos);
} finally {
IOUtils.closeQuietly(fis);
}
}
zos.closeEntry();
entries.put(entryName.toString(), eventType);
} else {
log.warn(
"Could not find the {} file to package for synchronization. Skipping it.",
file.getAbsolutePath());
}
zos.closeEntry();
entries.put(entryName.toString(), eventType);
} else if (eventType != LastEventType.DELETE) {
log.warn(
"Could not find the {} file to package for synchronization. Skipping it.",
file.getAbsolutePath());
}

command.append("}\n\n");
Expand Down

0 comments on commit 989e8c5

Please sign in to comment.