private static String sanitizeString(String str){
  if (!str.startsWith("http") && str.length() > MAX_STRING_LEN) {
    str=str.substring(0,MAX_STRING_LEN) + "[...]";
  }
  return escapeString(str);
}

private static String sanitizeString ( String str ) { if ( ! str . startsWith ( "http" ) && str . length ( ) > MAX_STRING_LEN ) { str = str . substring ( 0 , MAX_STRING_LEN ) + "[...]" ; } return escapeString ( str ) ; }
shortens and escapes the given string .
