liambloom / checker

A checker program that reads tests from an xml file and checks java code using them
0 stars 0 forks source link

Resource Loading Code Changes #63

Open liambloom opened 2 years ago

liambloom commented 2 years ago
// URL works fine with jars, but URI gets confused, and so resolve doesn't work properly
new URL("jar:file:///C:/foo/bar.jar!/foo").getPath() // => "file:///C:/foo/bar.jar!/foo"
new URI("jar:file:///C:/foo/bar.jar!/foo").getPath() // => null
new URI("jar:file:///C:/foo/bar.jar!/foo").resolve("./buz") // => "./buz"

// Non-jar URIs work fine
new URI("file:///C:/foo/bar.jar").resolve("./buz") // => file:/C:/foo/buz

* Items 2 and 3 may not be neccesary if I do:

Notes:
liambloom commented 2 years ago

Make it work with JAR/ZIP, by, if it is opaque and one of those two, creating a filesystem for the zip, changing the book URL (or the base, maybe?) to point in the zip filesystem, and resolving paths in the correct fs (zip fs or default)