geoserver/geoserver — pull request #568 by jodygarnett (2014-04-17 16:35:11+00:00)
Title: Migrate use of GeoserverDataDirectory to GeoServerResourceLoader (GSIP 106)

This is the first example of migrating the codebase to use the ResourceStore API.

And I could of chosen an easier example, vfnw GeoserverDataDirectory was the original "singleton" approach - which worked great for test cases.

Things to look out for during review:
1) Low-level Referencing Factory implementations try and access GeoServerResourceLoader ... before test startup is complete and get null back. The previous code ended up with a null base directory and did not notice.
2) Use of Resource / FileWatcher and ResourceListener rather than Timer
3) Removal of GeoserverDataDirectory completely - it is gone
4) GeoServerResourceLoader.url now "owns" the responsibility of parsing user supplied URL and determining if it is a File. It actually delegates to Files.url( baseDirectory, url ) which was required for some test cases.

For background see http://geoserver.org/display/GEOS/GSIP+106+-+ResourceStore+API

Specifically the notes http://geoserver.org/display/GEOS/Resource+API+Transition+Plan