Created
March 11, 2016 10:56
-
-
Save eyalgo/685f65d90286f65f0126 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.apache.spark.util | |
import org.apache.spark.util.ChildFirstURLClassLoader | |
import java.net.URL | |
class WhiteListClassLoader(urls: Array[URL], parent: ClassLoader, whiteList: List[String]) | |
extends ChildFirstURLClassLoader(urls, parent) { | |
override def loadClass(name: String) = { | |
if (whiteList.exists(name.startsWith)) { | |
super.loadClass(name) | |
} else { | |
parent.loadClass(name) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment