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