cucumber/cucumber-jvm — pull request #361 by lmcgrath (2012-07-17 04:08:57+00:00)
Title: Extend url protocols

**Solution to #360: Unable to extend URL protocols handled by ClasspathIterable**

I replaced the hard-coded dependencies on FileResourceIterator and ZipResourceIterator in the ClasspathIterable with a factory for loading resource iterators. Resource iterators are now created using ResourceIteratorFactory implementations and making these implementations available to the ClasspathIterable only requires a META-INF/services/cucumber.io.ResourceIteratorFactory file with the names of the implementing classes on each line.

The factory used by ClasspathIterable will try to find an appropriate factory to create resource iterators for each URL. If no appropriate factory is found, it will fall back to the ZipResourceIteratorFactory and then the FileResourceIteratorFactory. This means that existing behavior is not impacted by the changes.

There is a proof-of-concept test, cucumber.io.DelegatingResourceIteratorFactoryTest, which shows the META-INF/services/cucumber.io.ResourceIteratorFactory file in action. Other tests for fall-back capability with ZIP/File resource iterator factories would have been inconclusive because any test resources could exist either as a file or within a JAR depending on the test runtime environment.

**Other changes:**
* I added URL-decoding to the ResourceLoaderTest class's dir field because I'm on Windows and spaces in my path were causing the test to fail
* I added explicit generic argument to line 70 of cucumber.table.DataTable because I couldn't get the code to compile even with modifications to the compiler