I think a better way to do it would be:

```
if (success) {
  IOUtils.close(is, os);
} else {
  IOUtils.closeWhileHandlingException(is, os);
  if (dest != null && dest.exists()) {
    dest.delete();
  }
}
```