return ret;
}
- public static Res stringToRes(String url) {
+ public static Res stringToRes(String url) { return stringToRes(url, false); }
+ public static Res stringToRes(String url, boolean permitLocalFilesystem) {
if (url.indexOf('!') != -1)
return (Res)(new Zip(stringToRes(url.substring(0, url.lastIndexOf('!')))).get(url.substring(url.lastIndexOf('!') + 1)));
if (url.startsWith("http://")) return new HTTP(url);
if (url.startsWith("https://")) return new HTTP(url);
- if (url.startsWith("file:")) return new File(url.substring(5));
+ 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");
}
}
}
- // FIXME: dangerous
/** a file */
public static class File extends Res {
private String path;