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 few java . net . URL errors in handling of URLs with embedded params and pure query targets .