@Test void deleteBuild_deletesTheEntireBuildFolderWithAllSubfoldersAndFiles() { givenBuildFolderContainingSubfoldersAndFiles(); fileSystemOperationsDao.deleteBuild(buildIdentifier); expectBuildFolderIsDeleted(); expectBranchFolderStillExists(); }
public void deleteBuild(final BuildIdentifier buildIdentifier) { File buildFolder = getBuildFolder( buildIdentifier); if (!buildFolder.exists()) { LOGGER.debug("Build folder " + buildFolder.getAbsolutePath() + " does not exist, therefore it can't be deleted."); return; } try { FileUtils.deleteDirectory(buildFolder); LOGGER.info("Deleted build folder " + buildFolder.getAbsolutePath()); } catch (IOException e) { LOGGER.error("Can't delete build " + buildIdentifier, e); } }
FileSystemOperationsDao { public void deleteBuild(final BuildIdentifier buildIdentifier) { File buildFolder = getBuildFolder( buildIdentifier); if (!buildFolder.exists()) { LOGGER.debug("Build folder " + buildFolder.getAbsolutePath() + " does not exist, therefore it can't be deleted."); return; } try { FileUtils.deleteDirectory(buildFolder); LOGGER.info("Deleted build folder " + buildFolder.getAbsolutePath()); } catch (IOException e) { LOGGER.error("Can't delete build " + buildIdentifier, e); } } }
FileSystemOperationsDao { public void deleteBuild(final BuildIdentifier buildIdentifier) { File buildFolder = getBuildFolder( buildIdentifier); if (!buildFolder.exists()) { LOGGER.debug("Build folder " + buildFolder.getAbsolutePath() + " does not exist, therefore it can't be deleted."); return; } try { FileUtils.deleteDirectory(buildFolder); LOGGER.info("Deleted build folder " + buildFolder.getAbsolutePath()); } catch (IOException e) { LOGGER.error("Can't delete build " + buildIdentifier, e); } } FileSystemOperationsDao(); }
FileSystemOperationsDao { public void deleteBuild(final BuildIdentifier buildIdentifier) { File buildFolder = getBuildFolder( buildIdentifier); if (!buildFolder.exists()) { LOGGER.debug("Build folder " + buildFolder.getAbsolutePath() + " does not exist, therefore it can't be deleted."); return; } try { FileUtils.deleteDirectory(buildFolder); LOGGER.info("Deleted build folder " + buildFolder.getAbsolutePath()); } catch (IOException e) { LOGGER.error("Can't delete build " + buildIdentifier, e); } } FileSystemOperationsDao(); void deleteBuild(final BuildIdentifier buildIdentifier); void createBuildFolderIfItDoesNotExist(final BuildIdentifier buildIdentifier); boolean buildFolderExists(final BuildIdentifier buildIdentifier); }
FileSystemOperationsDao { public void deleteBuild(final BuildIdentifier buildIdentifier) { File buildFolder = getBuildFolder( buildIdentifier); if (!buildFolder.exists()) { LOGGER.debug("Build folder " + buildFolder.getAbsolutePath() + " does not exist, therefore it can't be deleted."); return; } try { FileUtils.deleteDirectory(buildFolder); LOGGER.info("Deleted build folder " + buildFolder.getAbsolutePath()); } catch (IOException e) { LOGGER.error("Can't delete build " + buildIdentifier, e); } } FileSystemOperationsDao(); void deleteBuild(final BuildIdentifier buildIdentifier); void createBuildFolderIfItDoesNotExist(final BuildIdentifier buildIdentifier); boolean buildFolderExists(final BuildIdentifier buildIdentifier);  }