/** * Delete the matching files and directories for the given file-set definition. * * @param fileSet The file-set matching rules, along with search base directory * @throws IOException If a matching file cannot be deleted */ public void delete( FileSet fileSet ) throws IOException { delete( fileSet, true ); }
if ( !delete( file ) )
public void execute( Map context ) throws Exception { Project project = store.getProject( getProjectId( context ) ); File workingDirectory = workingDirectoryService.getWorkingDirectory( project ); if ( workingDirectory.exists() ) { FileSetManager fileSetManager = new FileSetManager(); FileSet fileSet = new FileSet(); fileSet.setDirectory( workingDirectory.getPath() ); fileSet.addInclude( "**/**" ); // TODO : this with a configuration option somewhere ? fileSet.setFollowSymlinks( false ); fileSetManager.delete( fileSet ); } } }
public void execute( Map context ) throws Exception { Project project = ContinuumBuildAgentUtil.getProject( context ); File workingDirectory = buildAgentConfigurationService.getWorkingDirectory( project.getId() ); if ( workingDirectory.exists() ) { getLogger().debug( "Cleaning working directory " + workingDirectory.getAbsolutePath() ); FileSetManager fileSetManager = new FileSetManager(); FileSet fileSet = new FileSet(); fileSet.setDirectory( workingDirectory.getPath() ); fileSet.addInclude( "**/**" ); // TODO : this with a configuration option somewhere ? fileSet.setFollowSymlinks( false ); fileSetManager.delete( fileSet ); } } }
fileSetManager.delete( fileset );
public void execute( Map context ) throws Exception { Project project = projectDao.getProject( getProjectId( context ) ); List<Project> projectsWithCommonScmRoot = getListOfProjectsInGroupWithCommonScmRoot( context ); String projectScmRootUrl = getProjectScmRootUrl( context, project.getScmUrl() ); File workingDirectory = workingDirectoryService.getWorkingDirectory( project, projectScmRootUrl, projectsWithCommonScmRoot ); if ( workingDirectory.exists() ) { FileSetManager fileSetManager = new FileSetManager(); FileSet fileSet = new FileSet(); fileSet.setDirectory( workingDirectory.getPath() ); fileSet.addInclude( "**/**" ); // TODO : this with a configuration option somewhere ? fileSet.setFollowSymlinks( false ); fileSetManager.delete( fileSet ); } } }