public static String reverseDomain ( String user ) { StringBuilder sb = null ; String [ ] split = Split . split ( ' ' , user ) ; int at ; for ( int i = split . length - 1 ; i >= 0 ; -- i ) { if ( sb == null ) { sb = new StringBuilder ( ) ; } else { sb . append ( ' ' ) ; } if ( ( at = split [ i ] . indexOf ( ' ' ) ) > 0 ) { sb . append ( split [ i ] . subSequence ( at + 1 , split [ i ] . length ( ) ) ) ; } else { sb . append ( split [ i ] ) ; } } return sb == null ? "" : sb . toString ( ) ; }
Take a Fully Qualified User and get a Namespace from it .