return (answer != null) ? answer.toString() : null;
}
@Override
public Map<String, Object> getProfileFeatures(String versionId, String profileId) {
Profile profile = profileService.getVersion(versionId).getRequiredProfile(profileId);
Profile effectiveProfile = Profiles.getEffectiveProfile(fabricService, profileService.getOverlayProfile(profile));
Map<String, Boolean> isParentFeature = new HashMap<String, Boolean>();
for (String feature : profile.getFeatures()) {
isParentFeature.put(feature, Boolean.FALSE);
}
for (String feature : effectiveProfile.getFeatures()) {
if (isParentFeature.get(feature) == null) {
isParentFeature.put(feature, Boolean.TRUE);
}
}
Map<String, Object> rc = new HashMap<String, Object>();
List<Map<String, Object>> featureDefs = new ArrayList<Map<String, Object>>();
for (Map.Entry<String, Boolean> featureEntry : isParentFeature.entrySet()) {
Map<String, Object> featureDef = new HashMap<String, Object>();
featureDef.put("id", featureEntry.getKey());
featureDef.put("isParentFeature", featureEntry.getValue());
featureDefs.add(featureDef);
}
rc.put("featureDefinitions", featureDefs);
List<Map<String, Object>> repositoryDefs = new ArrayList<Map<String, Object>>();
for (String repo : effectiveProfile.getRepositories()) {
Map<String, Object> repoDef = new HashMap<String, Object>();
repoDef.put("id", repo);
Closeable closeable = null;
try {