I don't use `resource.toURI()` to because that can throw an exception and I was trying to be consistent with how its is already done in [ElasticsearchTestCase#getResource](https://github.com/elasticsearch/elasticsearch/blob/master/src/test/java/org/elasticsearch/test/ElasticsearchTestCase.java#L126).