public static String decodeFromRedirect(final String str){
  final String classMethod="SAML2Utils.decodeFromRedirect: ";
  if (StringUtils.isEmpty(str)) {
    debug.error(classMethod + "input is null.");
    return null;
  }
  if (debug.messageEnabled()) {
    debug.message(classMethod + "input string length : " + str.length());
    debug.message(classMethod + "input string is ===>" + str+ "<===");
  }
  byte[] input=Base64.decode(removeNewLineChars(str));
  if (input == null || input.length == 0) {
    debug.error(classMethod + "Base64 decoded result is null");
    return null;
  }
  input=Arrays.copyOf(input,input.length + 1);
  int bufferLength=2048;
  try {
    if (bufferLen != null && !bufferLen.isEmpty()) {
      bufferLength=Integer.parseInt(bufferLen);
    }
  }
 catch (  NumberFormatException nfe) {
    debug.error(classMethod + "Unable to parse buffer length.",nfe);
  }
  Inflater inflater=new Inflater(true);
  InflaterInputStream inflaterInputStream=new InflaterInputStream(new ByteArrayInputStream(input),inflater);
  ByteArrayOutputStream bout=new ByteArrayOutputStream(bufferLength);
  try {
    int b=inflaterInputStream.read();
    while (b != -1) {
      bout.write(b);
      b=inflaterInputStream.read();
    }
  }
 catch (  IOException e) {
    debug.error(classMethod + "There was a problem reading the compressed input",e);
    return null;
  }
 finally {
    IOUtils.closeIfNotNull(inflaterInputStream);
  }
  String result;
  try {
    result=bout.toString("UTF-8");
  }
 catch (  UnsupportedEncodingException uee) {
    debug.error(classMethod + "cannot convert byte array to string.",uee);
    return null;
  }
  if (debug.messageEnabled()) {
    debug.message(classMethod + "Return value: \n" + result);
  }
  return result;
}

public static String decodeFromRedirect ( final String str ) { final String classMethod = "SAML2Utils.decodeFromRedirect: " ; if ( StringUtils . isEmpty ( str ) ) { debug . error ( classMethod + "input is null." ) ; return null ; } if ( debug . messageEnabled ( ) ) { debug . message ( classMethod + "input string length : " + str . length ( ) ) ; debug . message ( classMethod + "input string is ===>" + str + "<===" ) ; } byte [ ] input = Base64 . decode ( removeNewLineChars ( str ) ) ; if ( input == null || input . length == 0 ) { debug . error ( classMethod + "Base64 decoded result is null" ) ; return null ; } input = Arrays . copyOf ( input , input . length + 1 ) ; int bufferLength = 2048 ; try { if ( bufferLen != null && ! bufferLen . isEmpty ( ) ) { bufferLength = Integer . parseInt ( bufferLen ) ; } } catch ( NumberFormatException nfe ) { debug . error ( classMethod + "Unable to parse buffer length." , nfe ) ; } Inflater inflater = new Inflater ( true ) ; InflaterInputStream inflaterInputStream = new InflaterInputStream ( new ByteArrayInputStream ( input ) , inflater ) ; ByteArrayOutputStream bout = new ByteArrayOutputStream ( bufferLength ) ; try { int b = inflaterInputStream . read ( ) ; while ( b != - 1 ) { bout . write ( b ) ; b = inflaterInputStream . read ( ) ; } } catch ( IOException e ) { debug . error ( classMethod + "There was a problem reading the compressed input" , e ) ; return null ; } finally { IOUtils . closeIfNotNull ( inflaterInputStream ) ; } String result ; try { result = bout . toString ( "UTF-8" ) ; } catch ( UnsupportedEncodingException uee ) { debug . error ( classMethod + "cannot convert byte array to string." , uee ) ; return null ; } if ( debug . messageEnabled ( ) ) { debug . message ( classMethod + "Return value: \n" + result ) ; } return result ; }
decodes the request message .
