[ https://issues.apache.org/jira/browse/NIFI-2020?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15368765#comment-15368765 ]
ASF GitHub Bot commented on NIFI-2020: -------------------------------------- Github user mattyb149 commented on a diff in the pull request: https://github.com/apache/nifi/pull/564#discussion_r70156926 --- Diff: nifi-commons/nifi-utils/src/main/java/org/apache/nifi/util/file/classloader/ClassLoaderUtils.java --- @@ -0,0 +1,66 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.util.file.classloader; + +import java.io.File; +import java.io.FilenameFilter; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.LinkedList; +import java.util.List; + +public class ClassLoaderUtils { + + public static ClassLoader getCustomClassLoader(String modulePath, ClassLoader parentClassLoader, FilenameFilter filenameFilter) throws MalformedURLException { + String[] modules = modulePath != null? modulePath.split(",") : null; + URL[] classpaths = getURLsForClasspath(modules,filenameFilter); + return createModuleClassLoader(classpaths,parentClassLoader); + } + + protected static URL[] getURLsForClasspath(String[] modulePaths, FilenameFilter filenameFilter) throws MalformedURLException { + List<URL> additionalClasspath = new LinkedList<>(); --- End diff -- Now that we can use Java 8, this method can probably be more concise using streams, lambdas, etc. Not a requirement, just a suggestion :) > Enhance JoltTransformJSON processor to support custom transforms > ---------------------------------------------------------------- > > Key: NIFI-2020 > URL: https://issues.apache.org/jira/browse/NIFI-2020 > Project: Apache NiFi > Issue Type: New Feature > Components: Core Framework > Affects Versions: 1.0.0 > Reporter: Yolanda M. Davis > Assignee: Yolanda M. Davis > Fix For: 1.0.0 > > > Jolt supports additional custom transforms via fully-qualified Java > classnames. Would like to provide the ability to support custom > transformation (via drop in jars) for the Jolt Transform processor. -- This message was sent by Atlassian JIRA (v6.3.4#6332)