public static String [ ] toStringArray ( Enumeration < String > enumeration ) { if ( enumeration == null ) { return null ; } List < String > list = java . util . Collections . list ( enumeration ) ; return list . toArray ( new String [ list . size ( ) ] ) ; }
Copy the given Enumeration into a String array . The Enumeration must contain String elements only .