public static void deleteSubDirs ( File dir ) { String [ ] children = dir . list ( ) ; for ( int i = 0 ; i < children . length ; i ++ ) { File f = new File ( dir , children [ i ] ) ; if ( f . isDirectory ( ) ) { deleteDir ( f ) ; } } }
Deletes just the sub directories for a certain directory