protected Principal getPrincipal ( final String name , final boolean isNtlm ) { if ( this . principalWithDomainName ) { return this . principalFactory . createPrincipal ( name ) ; } if ( isNtlm ) { if ( Pattern . matches ( "\\S+\\\\\\S+" , name ) ) { val splitList = Splitter . on ( Pattern . compile ( "\\\\" ) ) . splitToList ( name ) ; if ( splitList . size ( ) == 2 ) { return this . principalFactory . createPrincipal ( splitList . get ( 1 ) ) ; } } return this . principalFactory . createPrincipal ( name ) ; } val splitList = Splitter . on ( "@" ) . splitToList ( name ) ; return this . principalFactory . createPrincipal ( splitList . get ( 0 ) ) ; }
Gets the principal from the given name . The principal is created by the factory instance .