}
}
+ /** the Builtin resource */
+ public static class Builtin extends Res {
+ public Builtin() { };
+ public String getDescriptiveName() { return "[builtin]"; }
+ public InputStream getInputStream(String path) throws IOException {
+ if (!path.equals("")) throw new IOException("the builtin resource has no subresources");
+ return Platform.getBuiltinInputStream();
+ }
+ }
+
/** what you get when you reference a subresource */
public static class Ref extends Res {
Res parent;
Ref(Res parent, Object key) { this.parent = parent; this.key = key; }
public String getDescriptiveName() {
String pdn = parent.getDescriptiveName();
- return pdn.equals("") ? key.toString() : (pdn + "." + key.toString());
+ if (pdn.equals("")) return key.toString();
+ if (!pdn.endsWith("!")) pdn += ".";
+ return pdn + key.toString();
}
public Res addExtension(String extension) {
return (key instanceof String && ((String)key).endsWith(extension)) ? this : new Ref(parent, key + extension);