X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2FResources.java;h=c4e512e56a576cfea685caa6193373af474aa750;hb=d5f0e6ca91a3359b09352d3df367d6b6bd22f096;hp=f1934776844ada8889bd06e920a1453998cf905c;hpb=612fd27a45ddecb5df1621603a631223ec583408;p=org.ibex.core.git diff --git a/src/org/xwt/Resources.java b/src/org/xwt/Resources.java index f193477..c4e512e 100644 --- a/src/org/xwt/Resources.java +++ b/src/org/xwt/Resources.java @@ -4,10 +4,10 @@ package org.xwt; import java.io.*; import java.net.*; import java.util.*; -import jazz.*; +import java.util.zip.*; import java.lang.*; import java.applet.*; -import org.mozilla.javascript.*; +import org.xwt.js.*; import org.xwt.util.*; /** @@ -39,9 +39,8 @@ public class Resources { char c = name.charAt(i); if (!((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || - c == '_' || - (c >= '0' && c <= '9') || - (c == '.' && i == name.length() - 4))) return false; + c == '_' || c == '.' || + (c >= '0' && c <= '9'))) return false; } return true; } @@ -49,7 +48,9 @@ public class Resources { /** Load a directory as if it were an archive */ public static synchronized void loadDirectory(File dir) throws IOException { loadDirectory(dir, ""); } private static synchronized void loadDirectory(File dir, String prefix) throws IOException { - new Static(prefix.replace(File.separatorChar, '.')); + String n = prefix.replace(File.separatorChar, '.'); + if (n.endsWith(".")) n = n.substring(0, n.length() - 1); + new Static(n); String[] subfiles = dir.list(); for(int i=0; i