code: public static List<File> listDirectories( File root ) {
  
  		List<File> result = new ArrayList<> ();
  		File[] files = root.listFiles( new DirectoryFileFilter());
  		if( files != null )
  			result.addAll( Arrays.asList( files ));
  
  		Collections.sort( result, new FileNameComparator());
  		return result;
  	}
docs: Lists directories located under a given file.
  @param root a file
  @return a non-null list of directories, sorted alphabetically by file names