DatabaseCheckpointSupport extends ComponentSupport implements Checkpoint { @Override public void end() { checkState(upgradeDir != null); checkState(backupZip != null); log.debug("Deleting backup from {}", upgradeDir); try { Files.delete(backupZip.toPath()); Files.delete(upgradeDir.toPath()); } catch (IOException e) { log.warn("Could not delete backup of {} database, please delete {} manually. Error: {}", databaseName, upgradeDir, e.toString()); } backupZip = null; failedZip = null; upgradeDir = null; } protected  DatabaseCheckpointSupport(final String databaseName,
                                      final Provider<DatabaseInstance> databaseInstance,
                                      final ApplicationDirectories appDirectories); @Override void begin(String version); @Override void commit(); @Override void rollback(); @Override void end();  }
@Test public void testEnd() throws Exception { checkpoint.begin("1.1"); assertThat(findBackupFiles(DB_NAME, "1.1"), is(arrayWithSize(1))); checkpoint.commit(); checkpoint.end(); assertThat(upgradeDir.exists(), is(false)); }