private String extractHumanReadableRealmString(String realm){
  if (realm == null || !realm.contains("o=")) {
    return "";
  }
  List<String> tokens=new ArrayList<String>();
  StringTokenizer tokenizer=new StringTokenizer(realm,",");
  while (tokenizer.hasMoreTokens()) {
    tokens.add(tokenizer.nextToken());
  }
  String extractedRealmString="";
  for (  String token : tokens) {
    if (token.contains("o=")) {
      extractedRealmString+="/" + token.substring(token.indexOf("=") + 1);
    }
  }
  extractedRealmString+="/";
  return extractedRealmString;
}

private String extractHumanReadableRealmString ( String realm ) { if ( realm == null || ! realm . contains ( "o=" ) ) { return "" ; } List < String > tokens = new ArrayList < String > ( ) ; StringTokenizer tokenizer = new StringTokenizer ( realm , "," ) ; while ( tokenizer . hasMoreTokens ( ) ) { tokens . add ( tokenizer . nextToken ( ) ) ; } String extractedRealmString = "" ; for ( String token : tokens ) { if ( token . contains ( "o=" ) ) { extractedRealmString += "/" + token . substring ( token . indexOf ( "=" ) + 1 ) ; } } extractedRealmString += "/" ; return extractedRealmString ; }
a less complicated string detailing just the realm information . this is both more human - friendly , and also fits better on a mobile app ' s screen .
