mass rename and rebranding from xwt to ibex - fixed to use ixt files
[org.ibex.core.git] / src / org / xwt / LocalStorage.java
diff --git a/src/org/xwt/LocalStorage.java b/src/org/xwt/LocalStorage.java
deleted file mode 100644 (file)
index 376ccb8..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.xwt;
-
-import java.io.*;
-import java.util.*;
-import java.util.zip.*;
-import org.xwt.js.*;
-import org.xwt.util.*;
-import org.bouncycastle.util.encoders.Base64;
-
-/** Manages access to ~/.xwt */
-public class LocalStorage {
-
-    static String xwtDirName = System.getProperty("user.home") + java.io.File.separatorChar + ".xwt";
-
-    static java.io.File xwtDir = null;
-    static java.io.File cacheDir = null;
-
-    static {
-        try {
-            xwtDir = new java.io.File(xwtDirName);
-            if (!xwtDir.mkdirs()) xwtDir = null;
-            try {
-                cacheDir = new java.io.File(xwtDirName + java.io.File.separatorChar + "cache");
-                if (!cacheDir.mkdirs()) cacheDir = null;
-            } catch (Exception e) {
-                Log.warn(LocalStorage.class, "unable to create cache directory " +
-                         xwtDirName + java.io.File.separatorChar + "cache");
-            }
-        } catch (Exception e) {
-            Log.warn(LocalStorage.class, "unable to create xwt directory " + xwtDirName);
-        }
-    }
-
-    // FEATURE: we ought to be able to do stuff like sha1-checking and date checking on cached resources    
-    public static class Cache {
-
-        private static void delTree(java.io.File f) throws IOException {
-            if (f.isDirectory()) {
-                String[] s = f.list();
-                for(int i=0; i<s.length; i++)
-                    delTree(new java.io.File(f.getPath() + java.io.File.separatorChar + s[i]));
-            }
-            f.delete();
-        }
-
-        public static void flush() throws IOException {
-            delTree(cacheDir);
-            cacheDir.mkdirs();
-        }
-
-        public static java.io.File getCacheFileForKey(String key) {
-            // FEATURE: be smarter here
-            return new java.io.File(cacheDir.getPath() + File.separatorChar + new String(Base64.encode(key.getBytes())));
-        }
-
-    }
-}