Actually if you are using Eclipse there is a short cut:
1. Selecting any reference to GeoServerDataDirectory or
GeoServerResourceLoader
File f = loader.*find*("monitoring", "GeoLiteCity.dat");
if (f != null) {
return new LookupService(f);
}
2. Right click on the method and select Refactor -> Inline
Resource resource = loader.get( Paths.path("monitoring", "GeoLiteCity.dat")
);
File f = Resources.find( resource );
if (f != null) {
return new LookupService(f);
}
3. The inlined code made use of a utility method Resources.find( resource )
to reproduce the logic of GeoServerResourceLoader based on
Resource.getType(). Type will be UNDEFINED, DIRECTORY or RESOURCE, with
that in mind we can make this a bit more clear: