public static List<URL> getManifestLibraries(DeploymentContext context, Manifest manifest) throws IOException { return getManifestLibraries(context.getSource(), manifest); }
public static List<URL> getManifestLibraries(DeploymentContext context) throws IOException { return getManifestLibraries(context.getSource()); }
public static List<URL> getManifestLibraries(ReadableArchive archive) throws IOException { return getManifestLibraries(archive, archive.getManifest()); }
public List<URL> getManifestLibraries(DeploymentContext context) { try { Manifest manifest = getManifest(context.getSource()); return DeploymentUtils.getManifestLibraries(context, manifest); }catch (IOException ioe) { _logger.log(Level.WARNING, "Exception while getting manifest classpath: ", ioe); return new ArrayList<URL>(); } }
public static List<URI> getExternalLibraries(ReadableArchive archive) { List<URI> externalLibURIs = new ArrayList<URI>(); try { List<URL> manifestURLs = getManifestLibraries(archive); URI archiveURI = archive.getURI(); if (archive.getParentArchive() != null) { archiveURI = archive.getParentArchive().getURI(); } for (URL manifestURL : manifestURLs) { URI manifestLibURI = archiveURI.relativize(manifestURL.toURI()); if (manifestLibURI.isAbsolute()) { File externalLib = new File(manifestLibURI); if (externalLib.exists()) { externalLibURIs.add(manifestLibURI); } } } } catch (Exception e) { Logger.getAnonymousLogger().log(Level.WARNING, e.getMessage(), e); } return externalLibURIs; }
public static List<URI> getLibraryJarURIs(Application app, ReadableArchive archive) throws Exception { List<URL> libraryURLs = new ArrayList<URL>(); List<URI> libraryURIs = new ArrayList<URI>(); // add libraries referenced through manifest libraryURLs.addAll(DeploymentUtils.getManifestLibraries(archive)); ReadableArchive parentArchive = archive.getParentArchive(); if (parentArchive == null) { return Collections.emptyList(); } File appRoot = new File(parentArchive.getURI()); // add libraries jars inside application lib directory libraryURLs.addAll(ASClassLoaderUtil.getAppLibDirLibrariesAsList( appRoot, app.getLibraryDirectory(), null)); for (URL url : libraryURLs) { libraryURIs.add(Util.toURI(url)); } return libraryURIs; }
public static List<URL> getLibraryJars(BundleDescriptor bundleDesc, ReadableArchive archive) throws IOException { List<URL> libraryURLs = new ArrayList<URL>(); // add libraries referenced through manifest libraryURLs.addAll(DeploymentUtils.getManifestLibraries(archive)); ReadableArchive parentArchive = archive.getParentArchive(); if (parentArchive == null || bundleDesc == null) { // ear level or standalone module return libraryURLs; } File appRoot = new File(parentArchive.getURI()); ModuleDescriptor moduleDesc = ((BundleDescriptor)bundleDesc).getModuleDescriptor(); Application app = ((BundleDescriptor)moduleDesc.getDescriptor()).getApplication(); // add libraries jars inside application lib directory libraryURLs.addAll(ASClassLoaderUtil.getAppLibDirLibrariesAsList( appRoot, app.getLibraryDirectory(), null)); return libraryURLs; }