scalan.util.ClassLoaderUtil.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of common_2.12 Show documentation
Show all versions of common_2.12 Show documentation
Compiling Scala to Something special
The newest version!
package scalan.util
import java.io.File
import java.net.URLClassLoader
object ClassLoaderUtil {
def classPath(loader: ClassLoader): Seq[File] = loader match {
case loader: URLClassLoader =>
loader.getURLs.map(FileUtil.urlToFile) ++ classPath(loader.getParent)
case _ =>
Nil
}
def URLClassLoader(files: TraversableOnce[File], parent: ClassLoader): URLClassLoader =
new URLClassLoader(files.map(_.toURI.toURL).toArray, parent)
}