List<String> dirContent = ( dir != null ) ? Arrays.asList( dir.list() ) : Collections.<String>emptyList();
Set<String> deleted = new HashSet<String>( checkoutContent );
deleted.removeAll( dirContent );
MatchPatterns ignoreDeleteMatchPatterns = null;
List<String> pathsAsList = new ArrayList<String>( 0 );
if ( ignorePathsToDelete != null && ignorePathsToDelete.length > 0 )
{
ignoreDeleteMatchPatterns = MatchPatterns.from( ignorePathsToDelete );
pathsAsList = Arrays.asList( ignorePathsToDelete );
}
for ( String name : deleted )
{
if ( ignoreDeleteMatchPatterns != null && ignoreDeleteMatchPatterns.matches( name, true ) )
{
getLog().debug(
name + " match one of the patterns '" + pathsAsList + "': do not add to deleted files" );
continue;
}