});
}
private IPath getKarafPlatformRootPath(final MBeanProvider service) {
final JMXServiceDescriptor jmxServiceDescriptor = service.getJMXServiceDescriptor();
final KarafPlatformModel karafPlatformModel =
(KarafPlatformModel) jmxServiceDescriptor.getAdapter(KarafPlatformModel.class);
if (karafPlatformModel == null) {
return new Path("");
}
// TODO: It should be easy to compare to KarafPlatformModel's for equality
final IPath rootDirectory;
if (karafPlatformModel instanceof KarafWorkingPlatformModel) {
rootDirectory = ((KarafWorkingPlatformModel) karafPlatformModel).getParentKarafModel().getRootDirectory();
} else {
rootDirectory = karafPlatformModel.getRootDirectory();
}
return rootDirectory;
}