public class ASClassLoaderUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static Logger |
deplLogger |
| Constructor and Description |
|---|
ASClassLoaderUtil() |
| Modifier and Type | Method and Description |
|---|---|
static URL[] |
convertURLListToArray(List<URL> list) |
static URL[] |
getAppLibDirLibraries(File appRoot,
String appLibDir,
String compatibilityProp)
add all the libraries packaged in the application library directory
|
static List<URL> |
getAppLibDirLibrariesAsList(File appRoot,
String appLibDir,
String compatibilityProp) |
static URL[] |
getDeployParamLibrariesAsURLs(String librariesStr,
org.glassfish.api.admin.ServerEnvironment env)
converts libraries specified via the --libraries deployment option to
URL[].
|
static List<URI> |
getLibDirectoryJarURIs(File moduleLibDirectory) |
static URL[] |
getLibrariesAsURLs(Set<String> librariesStr,
org.glassfish.api.admin.ServerEnvironment env)
converts libraries specified via EXTENSION_LIST entry in MANIFEST.MF of
all of the libraries of the deployed archive to
The libraries are made available to
the application in the order specified.
|
static Manifest |
getManifest(String rootPath)
Returns the manifest file for the given root path.
|
static List<URL> |
getManifestClassPathAsURLs(Manifest manifest,
String rootPath)
Returns the class path (if any) from the given manifest file as an
URL list.
|
static String |
getModuleClassPath(org.glassfish.hk2.api.ServiceLocator habitat,
org.glassfish.api.deployment.DeploymentContext context) |
static String |
getModuleClassPath(org.glassfish.hk2.api.ServiceLocator habitat,
String moduleId,
String deploymentLibs)
Gets the classpath associated with a module, suffixing libraries
defined [if any] for the application
|
static URL[] |
getURLs(File[] dirs,
File[] jarDirs,
boolean ignoreZip)
Returns an array of urls that contains ..
|
static List<URL> |
getURLsAsList(File[] dirs,
File[] jarDirs,
boolean ignoreZip)
Returns a list of urls that contains ..
|
static List<URL> |
getURLsFromClasspath(String classpath,
String delimiter,
String rootPath)
get URL list from classpath
|
public static final Logger deplLogger
public static String getModuleClassPath(org.glassfish.hk2.api.ServiceLocator habitat, String moduleId, String deploymentLibs)
habitat - the habitat the application resides in.moduleId - Module id of the moduledeploymentLibs - libraries option passed through deploymentFile.pathSeparator separated list of classpaths
for the passed in module, including the module specified
"libraries" defined for the module.public static String getModuleClassPath(org.glassfish.hk2.api.ServiceLocator habitat, org.glassfish.api.deployment.DeploymentContext context)
public static URL[] getLibrariesAsURLs(Set<String> librariesStr, org.glassfish.api.admin.ServerEnvironment env)
librariesStr - is a comma-separated list of library JAR filesenv - the server environmentpublic static URL[] getDeployParamLibrariesAsURLs(String librariesStr, org.glassfish.api.admin.ServerEnvironment env)
librariesStr - is a comma-separated list of library JAR filesenv - the server environmentpublic static URL[] getURLs(File[] dirs, File[] jarDirs, boolean ignoreZip) throws IOException
i. all the valid directories from the given directory (dirs) array
ii. all jar files from the given directory (jarDirs) array
iii. all zip files from the given directory (jarDirs) array if
not ignoring zip file (ignoreZip is false).
dirs - array of directory path namesjarDirs - array of path name to directories that contains
JAR & ZIP files.ignoreZip - whether to ignore zip filesIOException - if an i/o error while constructing the urlspublic static List<URL> getURLsAsList(File[] dirs, File[] jarDirs, boolean ignoreZip) throws IOException
i. all the valid directories from the given directory (dirs) array
ii. all jar files from the given directory (jarDirs) array
iii. all zip files from the given directory (jarDirs) array if
not ignoring zip file (ignoreZip is false).
dirs - array of directory path namesjarDirs - array of path name to directories that contains
JAR & ZIP files.ignoreZip - whether to ignore zip filesIOException - if an i/o error while constructing the urlspublic static List<URL> getURLsFromClasspath(String classpath, String delimiter, String rootPath)
classpath - classpath string containing the classpathsdelimiter - delimiter to separate the classpath components
in the classpath stringrootPath - root path of the classpath if the paths are relativepublic static Manifest getManifest(String rootPath)
rootPath - absolute path to the modulepublic static List<URL> getManifestClassPathAsURLs(Manifest manifest, String rootPath)
manifest - manifest file of an archiverootPath - root path to the modulepublic static URL[] getAppLibDirLibraries(File appRoot, String appLibDir, String compatibilityProp) throws IOException
appRoot - the application rootappLibDir - the Application library directorycompatibilityProp - the version of the release that we need to
maintain backward compatibilityIOExceptionpublic static List<URL> getAppLibDirLibrariesAsList(File appRoot, String appLibDir, String compatibilityProp) throws IOException
IOExceptionCopyright © 2014. All rights reserved.