Skip to content

Commit

Permalink
Complete conversion of URL -> URI interface with tests working
Browse files Browse the repository at this point in the history
Signed-off-by: reidspencer <reid.spencer@yoppworks.com>
  • Loading branch information
reid-spencer committed Sep 22, 2023
1 parent 7f44c0c commit 52167b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 4 additions & 2 deletions utils/src/main/scala/com/reactific/riddl/utils/Plugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ object Plugin {
Files.isReadable(path),
s"Candidate plugin $path is not a regular file"
)

URI.create(s"jar::/${path.toAbsolutePath.toString}").toURL
val ssp = "file://" + path.toAbsolutePath.toString + "!/"
val uri = new URI("jar", ssp, "")
uri.toURL
// URI.create(s"jar:file:${path.toAbsolutePath.toString}").toURL
}
PluginClassLoader(urls, getClass.getClassLoader)
} else { getClass.getClassLoader }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ import java.net.URLClassLoader

/** Loads a plugin using a [[java.net.URLClassLoader]].
*/
case class PluginClassLoader(
urls: List[URL],
parentClassLoader: ClassLoader)
case class PluginClassLoader(urls: List[URL], parentClassLoader: ClassLoader)
extends URLClassLoader(urls.toArray, parentClassLoader) {
require(urls.forall(_.getProtocol == "jar"))
override protected def loadClass(
Expand Down

0 comments on commit 52167b8

Please sign in to comment.