private List<ReadableArchive> getExternalLibraries( DeploymentContext context) throws IOException { List<ReadableArchive> externalLibArchives = new ArrayList<ReadableArchive>(); String skipScanExternalLibProp = context.getAppProps().getProperty( DeploymentProperties.SKIP_SCAN_EXTERNAL_LIB); if (Boolean.valueOf(skipScanExternalLibProp)) { // if we skip scanning external libraries, we should just // return an empty list here return Collections.EMPTY_LIST; } List<URI> externalLibs = DeploymentUtils.getExternalLibraries(context.getSource()); for (URI externalLib : externalLibs) { externalLibArchives.add(archiveFactory.openArchive(new File(externalLib.getPath()))); } return externalLibArchives; }
private List<ReadableArchive> getExternalLibraries( DeploymentContext context) throws IOException { List<ReadableArchive> externalLibArchives = new ArrayList<ReadableArchive>(); String skipScanExternalLibProp = context.getAppProps().getProperty( DeploymentProperties.SKIP_SCAN_EXTERNAL_LIB); if (Boolean.valueOf(skipScanExternalLibProp)) { // if we skip scanning external libraries, we should just // return an empty list here return Collections.EMPTY_LIST; } List<URI> externalLibs = DeploymentUtils.getExternalLibraries(context.getSource()); for (URI externalLib : externalLibs) { externalLibArchives.add(archiveFactory.openArchive(new File(externalLib.getPath()))); } return externalLibArchives; }
public boolean hasAnnotationInArchive(ReadableArchive archive) { scanArchive(archive); if (found) { return found; } ArchiveFactory archiveFactory = null; if (Globals.getDefaultHabitat() != null) { archiveFactory = Globals.getDefaultHabitat().getComponent(ArchiveFactory.class); } if (archiveFactory != null) { List<URI> externalLibs = DeploymentUtils.getExternalLibraries(archive); for (URI externalLib : externalLibs) { try { scanArchive(archiveFactory.openArchive(new File(externalLib.getPath()))); } catch(FileNotFoundException fnfe) { logger.log(Level.WARNING, "Cannot find archive " + externalLib.getPath() + " referenced from archive " + archive.getName() + ", it will be ignored for annotation scanning"); } catch (Exception e) { logger.log(Level.WARNING, e.getMessage(), e); } } } return found; }