All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scalan.util.ClassLoaderUtil.scala Maven / Gradle / Ivy

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)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy