protected static String extractHeaderComponent(String header,String component){
  String fullComponent=component + "=\"";
  int fullComponentLength=fullComponent.length();
  int index1=header.indexOf(fullComponent);
  if (index1 == -1) {
    return null;
  }
  int index2=header.indexOf("\"",index1 + fullComponentLength);
  if (index2 == -1) {
    return null;
  }
  return header.substring(index1 + fullComponentLength,index2);
}

protected static String extractHeaderComponent ( String header , String component ) { String fullComponent = component + "=\"" ; int fullComponentLength = fullComponent . length ( ) ; int index1 = header . indexOf ( fullComponent ) ; if ( index1 == - 1 ) { return null ; } int index2 = header . indexOf ( "\"" , index1 + fullComponentLength ) ; if ( index2 == - 1 ) { return null ; } return header . substring ( index1 + fullComponentLength , index2 ) ; }
extract a component of a header .
