public static URI createUri ( String uri ) throws MeteoException { if ( uri == null ) { throw new MeteoException ( "URI is null" ) ; } try { return new URI ( uri ) ; } catch ( URISyntaxException e ) { throw new MeteoException ( e ) ; } }
Wrap the construction of URL s to avoid throwing of checked MalformedURLException . Instead MeteoException is thrown .