question: public static String [ ] lsDirectories ( String directory ) throws Exception { String [ ] tmp = ls ( directory ) ; ArrayList < String > files = new ArrayList < > ( ) ; for ( String s : tmp ) { if ( isDirectory ( directory + File . separator + s ) ) files . add ( s ) ; } return files . toArray ( new String [ files . size ( ) ] ) ; }
target:  List the directories contained within a directory.