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 {
/** 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 */
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 */