if (files != null) {
for (File archiveFile : files) {
if (!archiveFile.isDirectory()) {
try {
ViewConfig viewConfig = helper.getViewConfigFromArchive(archiveFile);
String viewName = ViewEntity.getViewName(viewConfig.getName(), viewConfig.getVersion());
String archivePath = extractedArchivesPath + File.separator + viewName;
// extract the archive and get the class loader
ClassLoader cl = extractViewArchive(archiveFile, helper.getFile(archivePath));
ViewEntity viewDefinition = createViewDefinition(viewConfig, configuration, cl, archivePath);
Set<ViewInstanceEntity> instanceDefinitions = new HashSet<ViewInstanceEntity>();
for (InstanceConfig instanceConfig : viewConfig.getInstances()) {
try {
instanceDefinitions.add(createViewInstanceDefinition(viewDefinition, instanceConfig));
} catch (Exception e) {
LOG.error("Caught exception adding view instance for view " +
viewDefinition.getViewName(), e);