Feature[] features = null;
try {
if (location != null) {
repoURI = new URI(location);
}
QueryContext queryContext = new QueryContext();
queryContext.setShowLatestVersionsOnly(showOnlyTheLatestFeatures);
queryContext.setQueryable(RepositoryUtils.getQuerybleRepositoryManager(repoURI));
AvailableIUQuery availableIUQuery = new AvailableIUQuery(queryContext);
IInstallableUnit[] installableUnits = ProvisioningUtils.performIUQuery(availableIUQuery);
features = ProvWSUtils.wrapAvailableFeatures(installableUnits, queryContext.getQueryable());
} catch (URISyntaxException e) {
handleException("Invalid Repository Location :" + location, "invalid.repo.location", e);
} catch (Exception e) {
handleException("Error occured while quering installable features",
"failed.get.installable.features", e);