2003/11/29 03:06:09
[org.ibex.core.git] / src / org / xwt / Res.java
index 7da19ce..f37d758 100644 (file)
@@ -101,7 +101,7 @@ public abstract class Res extends JS {
         public String toString() { return "byte[]"; }
         public String getCacheKey() throws NotCacheableException { return cacheKey; }
         public InputStream getInputStream(String path) throws IOException {
-            if (!"".equals(path)) throw new JSExn("can't get subresources of a byte[] resource");
+            if (!"".equals(path)) throw new IOException("can't get subresources of a byte[] resource");
             return new ByteArrayInputStream(bytes);
         }
     }
@@ -131,7 +131,7 @@ public abstract class Res extends JS {
             ZipInputStream zis = new ZipInputStream(pis);
             ZipEntry ze = zis.getNextEntry();
             while(ze != null && !ze.getName().equals(path)) ze = zis.getNextEntry();
-            if (ze == null) throw new JSExn("requested file (" + path + ") not found in archive");
+            if (ze == null) throw new IOException("requested file (" + path + ") not found in archive");
             return new KnownLength.KnownLengthInputStream(zis, (int)ze.getSize());
         }
     }
@@ -190,7 +190,7 @@ public abstract class Res extends JS {
                     public int read(byte[] b, int off, int len) throws IOException {
                         int ret = super.read(b, off, len);
                         if (ret != 1) bytesDownloaded += ret;
-                        Scheduler.add(new Scheduler.Task() { public void perform() {
+                        Scheduler.add(new Scheduler.Task() { public void perform() throws Exception {
                             callback.call(N(bytesDownloaded),
                                           N(is instanceof KnownLength ? ((KnownLength)is).getLength() : 0), null, null, 2);
                         } });