@Override
public Set<String> getBundleVersionFilenames(Subject subject, int bundleVersionId, boolean withoutBundleFileOnly)
throws Exception {
BundleVersion bundleVersion = entityManager.find(BundleVersion.class, bundleVersionId);
if (null == bundleVersion) {
throw new IllegalArgumentException("Invalid bundleVersionId: " + bundleVersionId);
}
checkCreateBundleVersionAuthz(subject, bundleVersion.getBundle().getId());
Set<String> result = null;
//new in 4.13 - we no longer throw an exception on failure to parse
try {
// parse the recipe (validation occurs here) and get the config def and list of files
BundleType bundleType = bundleVersion.getBundle().getBundleType();
RecipeParseResults parseResults = BundleManagerHelper.getPluginContainer().getBundleServerPluginManager()
.parseRecipe(bundleType.getName(), bundleVersion.getRecipe());
result = parseResults.getBundleFileNames();
} catch (Exception e) {
if (LOG.isDebugEnabled()) {
LOG.debug("Failed to parse the recipe of bundle version " + bundleVersionId
+ " while trying to get the list of bundle file names: " + e.getMessage());
}
}
if (result == null) {
return Collections.emptySet();
}
if (withoutBundleFileOnly) {
List<BundleFile> bundleFiles = bundleVersion.getBundleFiles();
Set<String> allFilenames = result;
result = new HashSet<String>(allFilenames.size() - bundleFiles.size());
for (String filename : allFilenames) {
boolean found = false;
for (BundleFile bundleFile : bundleFiles) {