Browse Source

bug 59312: delete temporary files even when the output stream cannot be closed (such as out of disk space IOException)

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1738848 13f79535-47bb-0310-9956-ffa450edef68
tags/REL_3_15_BETA2
Javen O'Neal 8 years ago
parent
commit
3a44eba6a2
1 changed files with 7 additions and 2 deletions
  1. 7
    2
      src/ooxml/java/org/apache/poi/xssf/streaming/SheetDataWriter.java

+ 7
- 2
src/ooxml/java/org/apache/poi/xssf/streaming/SheetDataWriter.java View File

@@ -375,7 +375,12 @@ public class SheetDataWriter {
* @return true if the file was deleted, false if it wasn't.
*/
boolean dispose() throws IOException {
_out.close();
return _fd.delete();
final boolean ret;
try {
_out.close();
} finally {
ret = _fd.delete();
}
return ret;
}
}

Loading…
Cancel
Save