mirror of
https://github.com/apache/poi.git
synced 2026-02-27 20:40:08 +08:00
[github-911] close DataSource before deleting temp file
This commit is contained in:
parent
7a124135de
commit
03fc1ddea1
@ -47,12 +47,15 @@ public class TempFilePOIFSFileSystem extends POIFSFileSystem {
|
||||
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
if (tempFile != null && tempFile.exists()) {
|
||||
if (!tempFile.delete()) {
|
||||
LOG.atDebug().log("temp file was already deleted (probably due to previous call to close this resource)");
|
||||
try {
|
||||
super.close();
|
||||
} finally {
|
||||
if (tempFile != null && tempFile.exists()) {
|
||||
if (!tempFile.delete()) {
|
||||
LOG.atDebug().log("temp file was already deleted (probably due to previous call to close this resource)");
|
||||
}
|
||||
}
|
||||
}
|
||||
super.close();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user