private static String maybeFixupURLForWindows(String url){
  if (url == null || url.length() < 2 || url.charAt(0) == '\\' || url.charAt(1) == ':')   return url;
  String lower_url=url.toLowerCase();
  int i=badEndings.length;
  while (i-- > 0)   if (lower_url.endsWith(badEndings[i]))   return fixupURLForWindows(url);
  return url;
}

private static String maybeFixupURLForWindows ( String url ) { if ( url == null || url . length ( ) < 2 || url . charAt ( 0 ) == '\\' || url . charAt ( 1 ) == ':' ) return url ; String lower_url = url . toLowerCase ( ) ; int i = badEndings . length ; while ( i -- > 0 ) if ( lower_url . endsWith ( badEndings [ i ] ) ) return fixupURLForWindows ( url ) ; return url ; }
if the default browser is internet explorer 5 . 0 or greater , the url . dll program fails if the url ends with . htm or . html . this problem is described by microsoft at http : / / support . microsoft . com / support / kb / articles / q283 / 2 / 25 . asp of course , their suggested workaround is to use the classes from the microsoft java sdk , but fortunately another workaround does exist . if you alter the url slightly so it no longer ends with " . htm " , the url can launch successfully . the logic here appends a null query string onto the end of the url if none is already present , or a bogus query parameter if there is already a query string ending in " . htm "
