public class ClassLoaderUtils extends Object
Modifier and Type | Field and Description |
---|---|
(package private) static org.slf4j.Logger |
LOGGER |
Constructor and Description |
---|
ClassLoaderUtils() |
Modifier and Type | Method and Description |
---|---|
protected static ClassLoader |
createModuleClassLoader(URL[] modules,
ClassLoader parentClassLoader) |
static String |
generateAdditionalUrlsFingerprint(Set<URL> urls) |
static ClassLoader |
getCustomClassLoader(String modulePath,
ClassLoader parentClassLoader,
FilenameFilter filenameFilter) |
private static long |
getLastModified(String url) |
static URL[] |
getURLsForClasspath(Set<String> modulePaths,
FilenameFilter filenameFilter,
boolean suppressExceptions) |
static URL[] |
getURLsForClasspath(String modulePath,
FilenameFilter filenameFilter,
boolean suppressExceptions) |
private static boolean |
isNotBlank(String value) |
protected static URL[] |
toURLs(Set<String> modulePaths,
FilenameFilter filenameFilter,
boolean suppressExceptions) |
public static ClassLoader getCustomClassLoader(String modulePath, ClassLoader parentClassLoader, FilenameFilter filenameFilter) throws MalformedURLException
MalformedURLException
public static URL[] getURLsForClasspath(String modulePath, FilenameFilter filenameFilter, boolean suppressExceptions) throws MalformedURLException
modulePath
- a module path to get URLs from, the module path may be
a comma-separated list of pathsfilenameFilter
- a filter to apply when a module path is a directory
and performs a listing, a null filter will return all matchessuppressExceptions
- indicates whether to suppress exceptionsMalformedURLException
- if a module path does not existpublic static URL[] getURLsForClasspath(Set<String> modulePaths, FilenameFilter filenameFilter, boolean suppressExceptions) throws MalformedURLException
modulePaths
- one or modules paths to get URLs from, each module
path may be a comma-separated list of pathsfilenameFilter
- a filter to apply when a module path is a directory
and performs a listing, a null filter will return all matchessuppressExceptions
- if true then all modules will attempt to be
resolved even if some throw an exception, if false the first exception
will be thrownMalformedURLException
- if a module path does not existprivate static boolean isNotBlank(String value)
protected static URL[] toURLs(Set<String> modulePaths, FilenameFilter filenameFilter, boolean suppressExceptions) throws MalformedURLException
MalformedURLException
public static String generateAdditionalUrlsFingerprint(Set<URL> urls)
private static long getLastModified(String url)
protected static ClassLoader createModuleClassLoader(URL[] modules, ClassLoader parentClassLoader)
Copyright © 2020 Apache NiFi Project. All rights reserved.