Fix fileChannel not closed, preventing delete to occur correctly
This commit is contained in:
parent
113c264d43
commit
8bb0a131a7
@ -210,6 +210,14 @@ public abstract class AbstractDiskHttpData extends AbstractHttpData {
|
||||
}
|
||||
|
||||
public void delete() {
|
||||
if (fileChannel != null) {
|
||||
try {
|
||||
fileChannel.force(false);
|
||||
fileChannel.close();
|
||||
} catch (IOException e) { //ignore
|
||||
}
|
||||
fileChannel = null;
|
||||
}
|
||||
if (! isRenamed) {
|
||||
if (file != null && file.exists()) {
|
||||
file.delete();
|
||||
|
Loading…
Reference in New Issue
Block a user