/** * When the write operation failed, call this method to * leave the original file intact and remove the temporary file. * This method can be safely invoked from the "finally" block, even after * the {@link #commit()} is called, to simplify coding. */ public void abort() throws IOException { closeAndDeleteTempFile(); }
@Override protected void finalize() throws Throwable { closeAndDeleteTempFile(); }