private URL normalizeLink ( String link ) { try { if ( StringUtils . isEmpty ( link ) ) { return null ; } if ( link . startsWith ( "/" ) ) { return sspApi . getSSPUrl ( link , true ) ; } if ( link . startsWith ( "http://" ) || link . startsWith ( "https://" ) ) { return new URL ( link ) ; } // if all else fails, just tack on http:// and see if the URL parser can handle // it. Perhaps, not ideal... return new URL ( "http://" + link ) ; } catch ( MalformedURLException e ) { log . warn ( "Bad URL from SSP Entry: " + link , e ) ; return null ; } }
Some of the links I have seen from SSP are not well formed . Try to convert any URLs to a usable form .