if (app.debug) { x.printStackTrace(); }
    public void update() {        if (!file.exists()) {            remove();        } else {            ZipFile zip = null;            // collect created protos - we need this to check DbMappings for each created            // prototype afterwards            HashSet newPrototypes = new HashSet();            try {                lastmod = file.lastModified();                // System.err.println ("UPDATING ZIP FILE "+this);                zip = new ZipFile(file);                updatables = new HashSet();                for (Enumeration en = zip.entries(); en.hasMoreElements();) {                    ZipEntry entry = (ZipEntry) en.nextElement();                    String ename = entry.getName();                    StringTokenizer st = new StringTokenizer(ename, "/");                    int tokens = st.countTokens();                    if (tokens == 1) {                        String fname = st.nextToken();                        if ("app.properties".equalsIgnoreCase(fname)) {                            app.props.addProps(file.getName(), zip.getInputStream(entry));                        } else if ("db.properties".equalsIgnoreCase(fname)) {                            app.dbProps.addProps(file.getName(), zip.getInputStream(entry));                        }                    } else if (tokens == 2) {                        String dir = st.nextToken();                        String fname = st.nextToken();                        // System.err.println ("ZIPENTRY: "+ dir +" ~ "+fname);                        Prototype proto = app.typemgr.getPrototype(dir);                        if (proto == null) {                            proto = app.typemgr.createPrototype(dir, null);                            newPrototypes.add(proto);                        }                        if (fname.endsWith(".hac")) {                            String name = fname.substring(0, fname.lastIndexOf("."));                            String sourceName = file.getName() + "/" + ename;                            String content = getZipEntryContent(zip, entry);                            // System.err.println ("["+content+"]");                            ActionFile act = new ActionFile(content, name, sourceName,                                                            proto);                            proto.addActionFile(act);                            updatables.add(act);                        } else if (fname.endsWith(".hsp")) {                            String name = fname.substring(0, fname.lastIndexOf("."));                            String sourceName = file.getName() + "/" + ename;                            String content = getZipEntryContent(zip, entry);                            // System.err.println ("["+content+"]");                            Template tmp = new Template(content, name, sourceName, proto);                            proto.addTemplate(tmp);                            updatables.add(tmp);                        } else if (fname.endsWith(".skin")) {                            String name = fname.substring(0, fname.lastIndexOf("."));                            String content = getZipEntryContent(zip, entry);                            // System.err.println ("["+content+"]");                            SkinFile skin = new SkinFile(content, name, proto);                            proto.addSkinFile(skin);                            updatables.add(skin);                        } else if (fname.endsWith(".js")) {                            String sourceName = file.getName() + "/" + ename;                            String content = getZipEntryContent(zip, entry);                            // System.err.println ("["+content+"]");                            FunctionFile ff = new FunctionFile(content, sourceName, proto);                            proto.addFunctionFile(ff);                            updatables.add(ff);                        } else if ("type.properties".equalsIgnoreCase(fname)) {                            DbMapping dbmap = proto.getDbMapping();                            SystemProperties props = dbmap.getProperties();                            props.addProps(file.getName(), zip.getInputStream(entry));                        }                        // mark prototype as updated                        proto.markUpdated();                    }                }            } catch (Throwable x) {                System.err.println("Error updating ZipFile: " + x);            } finally {                try {                    zip.close();                } catch (Exception ignore) {                }            }        }    }