public String getAttribute ( final Attributes attributes , final String attributeName ) throws NamingException { if ( attributes == null || attributes . size ( ) == 0 ) { return null ; } else { final Attribute attribute = attributes . get ( attributeName ) ; if ( attribute != null ) { final Object o = attribute . get ( ) ; if ( o instanceof String ) { return ( String ) attribute . get ( ) ; } } } return null ; }
Retrieves an attribute by its name .