Fix fileChannel not closed, preventing delete to occur correctly
This commit is contained in:
parent
cac449a5e4
commit
19f9bcfe8b
@ -237,6 +237,14 @@ public abstract class AbstractDiskHttpData extends AbstractHttpData {
|
||||
|
||||
@Override
|
||||
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()) {
|
||||
if (!file.delete()) {
|
||||
|
Loading…
Reference in New Issue
Block a user