}
@Override
public Set<Capability> findProviders(Requirement requirement) {
String symbolicName = (String) requirement.getAttribute(IdentityNamespace.IDENTITY_NAMESPACE);
VersionRange versionRange = (VersionRange) requirement.getAttribute(IdentityNamespace.CAPABILITY_VERSION_ATTRIBUTE);
Set<Capability> result = new HashSet<Capability>();
// Find the module versions that match
File moduleDir = new File(modulesDir, symbolicName.replace(".", File.separator));
if (versionRange != null && moduleDir.isDirectory()) {
for (File file : moduleDir.listFiles()) {
if (!file.isDirectory() || file.getName().equals("main")) {
continue;
}
Version version;
try {
version = new Version(file.getName());
} catch (Throwable th) {
continue;
}
if (!versionRange.includes(version)) {
continue;
}
String modname = symbolicName + ":" + version;
ModuleIdentifier modid = ModuleIdentifier.fromString(modname);
try {