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
This commit is contained in:
Javen O'Neal 2016-04-12 18:48:31 +00:00
parent fd50426dc6
commit 3a44eba6a2
1 changed files with 7 additions and 2 deletions

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 {
final boolean ret;
try {
_out.close();
return _fd.delete();
} finally {
ret = _fd.delete();
}
return ret;
}
}