public void deleteAll ( ) { if ( trackedFiles . size ( ) == 0 ) { return ; } ArrayList < File > files = new ArrayList < File > ( trackedFiles ) ; Collections . sort ( files , filePathComparator ) ; for ( File file : files ) { if ( file . exists ( ) ) { if ( ! file . delete ( ) ) { throw new DataUtilException ( "Couldn't delete a tracked " + ( file . isFile ( ) ? "file" : "directory" + ": " ) + file . getAbsolutePath ( ) ) ; } } } trackedFiles . clear ( ) ; }
Delete all tracked files