Replace deprecated toURL() with toURI().toURL() as per the JavaDoc

The toURL() method is deprecated and should be replaced with toURI().toURL() as described by the JavaDoc.