Fix fileChannel not closed, preventing delete to occur correctly

This commit is contained in:
Frederic Bregier 2014-01-23 13:21:59 +01:00 committed by Trustin Lee
parent cac449a5e4
commit 19f9bcfe8b

View File

@ -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()) {