Added logic to convert first to URI before executing toURL so that
special characters like ## (which are used in tomcat parallel deployment
paths) don't cause issues