Fix fileChannel not closed, preventing delete to occur correctly

This commit is contained in:
Frederic Bregier 2014-01-23 13:23:27 +01:00 committed by Trustin Lee
parent 113c264d43
commit 8bb0a131a7

View File

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