public static String extractScheme(final String challengeStr) throws MalformedChallengeException {
  if (challengeStr == null) {
    throw new IllegalArgumentException("Challenge may not be null");
  }
  final int idx=challengeStr.indexOf(' ');
  String s=null;
  if (idx == -1) {
    s=challengeStr;
  }
 else {
    s=challengeStr.substring(0,idx);
  }
  if (s.equals("")) {
    throw new MalformedChallengeException("Invalid challenge: " + challengeStr);
  }
  return s.toLowerCase();
}

public static String extractScheme ( final String challengeStr ) throws MalformedChallengeException { if ( challengeStr == null ) { throw new IllegalArgumentException ( "Challenge may not be null" ) ; } final int idx = challengeStr . indexOf ( ' ' ) ; String s = null ; if ( idx == - 1 ) { s = challengeStr ; } else { s = challengeStr . substring ( 0 , idx ) ; } if ( s . equals ( "" ) ) { throw new MalformedChallengeException ( "Invalid challenge: " + challengeStr ) ; } return s . toLowerCase ( ) ; }
extracts authentication scheme from the given authentication challenge .
