public static class NotCacheableException extends Exception { }
// streams are "sealed" by default to prevent accidental object leakage
public static class NotCacheableException extends Exception { }
// streams are "sealed" by default to prevent accidental object leakage
- protected Object _get(Object key) throws JSExn { return null; }
- public final Object get(Object key) throws JSExn {
+ protected Object _get(Object key) { return null; }
+ public final Object get(Object key) {
Object ret = getCache.get(key);
if (ret == null) getCache.put(key, ret = _get(key));
return ret;
Object ret = getCache.get(key);
if (ret == null) getCache.put(key, ret = _get(key));
return ret;
private String url;
public String toString() { return "Stream.HTTP:" + url; }
HTTP(String url) { while (url.endsWith("/")) url = url.substring(0, url.length() - 1); this.url = url; }
private String url;
public String toString() { return "Stream.HTTP:" + url; }
HTTP(String url) { while (url.endsWith("/")) url = url.substring(0, url.length() - 1); this.url = url; }
public String getCacheKey(Vec path) throws NotCacheableException { return url; }
public InputStream getInputStream() throws IOException { return new org.ibex.HTTP(url).GET(); }
}
public String getCacheKey(Vec path) throws NotCacheableException { return url; }
public InputStream getInputStream() throws IOException { return new org.ibex.HTTP(url).GET(); }
}
public String toString() { return "file:" + path; }
public String getCacheKey() throws NotCacheableException { throw new NotCacheableException(); /* already on disk */ }
public InputStream getInputStream() throws IOException { return new FileInputStream(path); }
public String toString() { return "file:" + path; }
public String getCacheKey() throws NotCacheableException { throw new NotCacheableException(); /* already on disk */ }
public InputStream getInputStream() throws IOException { return new FileInputStream(path); }
public InputStream getInputStream() throws IOException {
InputStream pis = parent.getInputStream();
ZipInputStream zis = new ZipInputStream(pis);
public InputStream getInputStream() throws IOException {
InputStream pis = parent.getInputStream();
ZipInputStream zis = new ZipInputStream(pis);
Cab(Stream parent) { this(parent, null); }
Cab(Stream parent, String path) { this.parent = parent; this.path = path; }
public String getCacheKey() throws NotCacheableException { return parent.getCacheKey() + "!cab:"; }
Cab(Stream parent) { this(parent, null); }
Cab(Stream parent, String path) { this.parent = parent; this.path = path; }
public String getCacheKey() throws NotCacheableException { return parent.getCacheKey() + "!cab:"; }