new js api
[org.ibex.core.git] / src / org / ibex / js / Directory.java
index 5f5ac38..1728e5b 100644 (file)
@@ -43,7 +43,8 @@ public class Directory extends JS {
      *  Create the directory object.  Existing directories will be
      *  preserved; if a file is present it will be obliterated.
      */ 
-    public Directory(File f) throws IOException {
+    // FIXME: Update this for new API
+    /*public Directory(File f) throws IOException {
         this.f = f;
         if (!f.exists()) new Directory(new File(f.getParent()));
         if (!f.isDirectory()) destroy(f);
@@ -93,7 +94,7 @@ public class Directory extends JS {
             File f2 = new File(f.getAbsolutePath() + File.separatorChar + FileNameEncoder.encode(key));
             if (!f2.exists()) return null;
             if (f2.isDirectory()) return new Directory(f2);
-            char[] chars = new char[(int)f2.length()];
+            char[] chars = new char[((int)f2.length()) * 2];
             int numchars = 0;
             Reader r = new InputStreamReader(new FileInputStream(f2));
             while(true) {
@@ -113,5 +114,5 @@ public class Directory extends JS {
                 public boolean hasMoreElements() { return i < elements.length; }
                 public Object nextElement() { return FileNameEncoder.decode(elements[i++]); }
             };
-    }
+    }*/
 }