Class ClassLoaderUtils
java.lang.Object
org.apache.nifi.util.file.classloader.ClassLoaderUtils
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static ClassLoader
createModuleClassLoader
(URL[] modules, ClassLoader parentClassLoader) static String
generateAdditionalUrlsFingerprint
(Set<URL> urls, String classloaderIsolationKey) Generate fingerprint from URLs associated with classpath resourcesstatic ClassLoader
getCustomClassLoader
(String modulePath, ClassLoader parentClassLoader, FilenameFilter filenameFilter) private static long
getLastModified
(String url) static URL[]
getURLsForClasspath
(String modulePath, FilenameFilter filenameFilter, boolean suppressExceptions) static URL[]
getURLsForClasspath
(Set<String> modulePaths, FilenameFilter filenameFilter, boolean suppressExceptions) private static boolean
isNotBlank
(String value) protected static URL[]
toURLs
(Set<String> modulePaths, FilenameFilter filenameFilter, boolean suppressExceptions)
-
Field Details
-
LOGGER
static final org.slf4j.Logger LOGGER
-
-
Constructor Details
-
ClassLoaderUtils
public ClassLoaderUtils()
-
-
Method Details
-
getCustomClassLoader
public static ClassLoader getCustomClassLoader(String modulePath, ClassLoader parentClassLoader, FilenameFilter filenameFilter) throws MalformedURLException - Throws:
MalformedURLException
-
getURLsForClasspath
public static URL[] getURLsForClasspath(String modulePath, FilenameFilter filenameFilter, boolean suppressExceptions) throws MalformedURLException - Parameters:
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 exceptions- Returns:
- an array of URL instances representing all of the modules resolved from processing modulePath
- Throws:
MalformedURLException
- if a module path does not exist
-
getURLsForClasspath
public static URL[] getURLsForClasspath(Set<String> modulePaths, FilenameFilter filenameFilter, boolean suppressExceptions) throws MalformedURLException - Parameters:
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 thrown- Returns:
- an array of URL instances representing all of the modules resolved from processing modulePaths
- Throws:
MalformedURLException
- if a module path does not exist
-
isNotBlank
-
toURLs
protected static URL[] toURLs(Set<String> modulePaths, FilenameFilter filenameFilter, boolean suppressExceptions) throws MalformedURLException - Throws:
MalformedURLException
-
generateAdditionalUrlsFingerprint
public static String generateAdditionalUrlsFingerprint(Set<URL> urls, String classloaderIsolationKey) Generate fingerprint from URLs associated with classpath resources- Parameters:
urls
- URLs used for generating fingerprint string- Returns:
- Fingerprint string from provided URLs
-
getLastModified
-
createModuleClassLoader
-