for (ExportedInstance<ProjectLocator> instance : registry.getExportedInstances(ProjectLocator.class))
{
DirectoryResource r = target;
while (r != null && result == null)
{
ProjectLocator locator = instance.get();
if (locator.containsProject(target))
{
result = locator.createProject(target);
if (!filter.accept(result))
result = null;
}
r = (r.getParent() == null ? null : r.getParent().reify(DirectoryResource.class));