{
IKarafProject karafProject = null;
final KarafPlatformModel karafPlatformModel = (KarafPlatformModel) adaptableObject;
for (final IProject project : ResourcesPlugin.getWorkspace().getRoot().getProjects()) {
if (KarafProject.isKarafProject(project)) {
karafProject = new KarafProject(project);
if (karafPlatformModel.getRootDirectory().equals(karafProject.getPlatformRootDirectory())) {
break;
}
}
}
adapted = karafProject;
} else if ( IKarafProject.class.equals(adapterType)
&& adaptableObject instanceof IProject)
{
if (KarafProject.isKarafProject((IProject) adaptableObject)) {
adapted = new KarafProject((IProject) adaptableObject);
} else {
return null;
}
} else {
adapted = null;