X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2FRes.java;h=1f1a9279e90f20b458962cfedaeeb8595de95d31;hb=1019725cfa88d9ad5dfabaf178e87da79c9c3e17;hp=bb6394043808d51b5e553f691c5b2e47386c9c84;hpb=5ef18e2b3993d3c515a0b51a1326b2ad11285f4a;p=org.ibex.core.git diff --git a/src/org/xwt/Res.java b/src/org/xwt/Res.java index bb63940..1f1a927 100644 --- a/src/org/xwt/Res.java +++ b/src/org/xwt/Res.java @@ -6,6 +6,7 @@ import java.util.*; import java.util.zip.*; import org.xwt.js.*; import org.xwt.util.*; +import org.bouncycastle.util.encoders.Base64; /** base class for XWT resources */ public abstract class Res extends JS { @@ -15,6 +16,8 @@ public abstract class Res extends JS { /** cache of subresources so that the equality operator works on them */ private Hash refCache = null; + public Template t = null; + public Res getParent() { return null; } /** returns an InputStream containing the Resource's contents */ @@ -50,7 +53,8 @@ public abstract class Res extends JS { if (url.startsWith("https://")) return new HTTP(url); if (url.startsWith("file:") && permitLocalFilesystem) return new File(url.substring(5)); if (url.startsWith("cab:")) return new CAB(stringToRes(url.substring(4))); - throw new JS.Exn("invalid resource specifier"); + if (url.startsWith("data:")) return new ByteArray(Base64.decode(url.substring(5))); + throw new JS.Exn("invalid resource specifier " + url); } /** HTTP or HTTPS resource */