diff options
Diffstat (limited to 'stage1/URLClassLoader.scala')
-rw-r--r-- | stage1/URLClassLoader.scala | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/stage1/URLClassLoader.scala b/stage1/URLClassLoader.scala new file mode 100644 index 0000000..870f186 --- /dev/null +++ b/stage1/URLClassLoader.scala @@ -0,0 +1,22 @@ +package cbt + +import java.net._ + +case class URLClassLoader(classPath: ClassPath, parent: ClassLoader) + extends java.net.URLClassLoader( + classPath.strings.map( + path => new URL("file:"++path) + ).toArray, + parent + ){ + override def toString = ( + scala.Console.BLUE ++ "cbt.URLClassLoader" ++ scala.Console.RESET + ++ "(\n " ++ getURLs.map(_.toString).sorted.mkString(",\n ") + ++ ( + if(getParent() != ClassLoader.getSystemClassLoader()) + ",\n" ++ getParent().toString.split("\n").map(" "++_).mkString("\n") + else "" + ) + ++ "\n)" + ) +} |