protected static String extractEncoding(String line){
  Pattern p=Pattern.compile(EXTRACT_ENCODING_REGEX);
  String[] matches=p.split(line);
  String value=matches[1];
  String[] cleanup=value.split("\"");
  String encoding=cleanup[0];
  return encoding.toLowerCase();
}

protected static String extractEncoding ( String line ) { Pattern p = Pattern . compile ( EXTRACT_ENCODING_REGEX ) ; String [ ] matches = p . split ( line ) ; String value = matches [ 1 ] ; String [ ] cleanup = value . split ( "\"" ) ; String encoding = cleanup [ 0 ] ; return encoding . toLowerCase ( ) ; }
helper method to extract the xml file encoding
