I would like to make a ResourceAccessor (2.0) that can interpret Strings as URLs.
(Or perhaps one already exists somewhere?)
I am not clear on the (undocumented) ResourceAccessor/FileOpener contract.
What does toClassLoader() do? I could see that for a ClassLoaderResourceAccessor it might simply return something like the Thread.currentThread().getContextClassLoader(), but what should it return in my case, where I am not going to store any persistent state in member variables? What is the return value used for?
What does getResources(packageName) do? I assume this is to abstract away something related to ClassLoader.getResources, but again, when is it used, and what is the return value good for? Is packageName always truly a package name, or is it just an arbitrary string? Can it be null?
(Finally, the larger use case is that I’d like to dynamically aggregate a bunch of changelog fragments together. I’m deliberately punting on the topological sorting issue, and am relying on the fact that due to my project organization it is highly, highly unlikely that any two fragments will depend on one another. So I’m planning on starting out by doing ClassLoader.getResources("/META-INF/liquibase/changelog.xml"), and then, armed with a pile of URLs originating in various jar files around the classpath, I will either make a new DatabaseChangeLog that is the result of programmatically reading all these other DatabaseChangeLogs in, or create a temp file that does the inclusion for me.)