if (str.endsWith(".jpeg") || str.endsWith(".jpg"))
str = "http://xmlrpc.xwt.org/jpeg2png/" + str.substring(str.indexOf("//") + 2);
- final HTTP http = new HTTP(str);
- final int contentLength = http.getContentLength();
- InputStream is = new FilterInputStream(http.getInputStream()) {
+ HTTP http = new HTTP(str);
+ final HTTP.HTTPInputStream in = http.GET();
+ final int contentLength = in.getContentLength();
+ InputStream is = new FilterInputStream(in) {
int bytesDownloaded = 0;
boolean clear = true;
public int read() throws IOException {
return ret;
}
};
-
- if (str.endsWith(".gif")) ret = GIF.decode(is, str);
- else ret = PNG.decode(is, str);
- return ret;
+
+ if (str.endsWith(".gif")) return GIF.decode(is, str);
+ else return PNG.decode(is, str);
} catch (IOException e) {
if (Log.on) Log.log(Box.class, "error while trying to load an image from " + str);
return super.has(name, start);
}
+ public Object[] getIds() {
+ Object[] ret = new Object[numChildren()];
+ for(int i=0; i<ret.length; i++) ret[i] = get(i, null);
+ return ret;
+ }
+
public void put(String name, Scriptable start, Object value) { put(name, start, value, false, null); }
public void put(String name, Scriptable start, Object value, boolean ignoretraps) { put(name, start, value, ignoretraps, null); }