public static URL resolveURL(URL base,String target) throws MalformedURLException {
  target=target.trim();
  if (target.startsWith("?")) {
    return fixPureQueryTargets(base,target);
  }
  return new URL(base,target);
}

public static URL resolveURL ( URL base , String target ) throws MalformedURLException { target = target . trim ( ) ; if ( target . startsWith ( "?" ) ) { return fixPureQueryTargets ( base , target ) ; } return new URL ( base , target ) ; }
resolve relative url - s and fix a java . net . url error in handling of urls with pure query targets .
