Github user olegz commented on a diff in the pull request:
https://github.com/apache/nifi/pull/1156#discussion_r86525918
--- Diff:
nifi-commons/nifi-utils/src/main/java/org/apache/nifi/util/file/classloader/ClassLoaderUtils.java
---
@@ -52,23 +85,33 @@ public static ClassLoader getCustomClassLoader(String
modulePath, ClassLoader pa
isUrl = false;
}
if (!isUrl) {
- File modulePath = new File(modulePathString);
+ try {
+ File modulePath = new File(modulePathString);
- if (modulePath.exists()) {
+ if (modulePath.exists()) {
-
additionalClasspath.add(modulePath.toURI().toURL());
+
additionalClasspath.add(modulePath.toURI().toURL());
- if (modulePath.isDirectory()) {
- File[] files =
modulePath.listFiles(filenameFilter);
+ if (modulePath.isDirectory()) {
+ File[] files =
modulePath.listFiles(filenameFilter);
- if (files != null) {
- for (File jarFile : files) {
-
additionalClasspath.add(jarFile.toURI().toURL());
+ if (files != null) {
+ for (File jarFile : files) {
--- End diff --
Since this one is really a stylistic comment, will leave it up to you, but.
. .
After the change to determine if it's a directory, calling it _jarFile_
doesn't make much sense. Also, given that claspath can also have non-JAR
resources (e.g., configuration, property files etc.) I think simply calling it
something like _cpEntry_ or _classpathEntry_ would be more appropriate.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---