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
|
@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()) {
|
||||||
if (!file.delete()) {
|
if (!file.delete()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user