URL[] urls = ((URLClassLoader) TypeManager.class.getClassLoader()).getURLs(); URL helmajar = null;
URL helmajar = TypeManager.class.getResource("/");
    public TypeManager(Application app) throws MalformedURLException {        this.app = app;        appDir = app.appDir;        // make sure the directories for the standard prototypes exist, and lament otherwise        if (appDir.list().length == 0) {            for (int i = 0; i < standardTypes.length; i++) {                File f = new File(appDir, standardTypes[i]);                if (!f.exists() && !f.mkdir()) {                    app.logEvent("Warning: directory " + f.getAbsolutePath() +                                 " could not be created.");                } else if (!f.isDirectory()) {                    app.logEvent("Warning: " + f.getAbsolutePath() +                                 " is not a directory.");                }            }        }        prototypes = new HashMap();        zipfiles = new HashMap();        jarfiles = new HashSet();        URL[] urls = ((URLClassLoader) TypeManager.class.getClassLoader()).getURLs();        URL helmajar = null;        for (int i = 0; i < urls.length; i++) {            String url = urls[i].toString().toLowerCase();            if (url.endsWith("helma.jar")) {                helmajar = urls[i];                break;            }        }        if (helmajar == null) {            throw new RuntimeException("helma.jar not found in embedding classpath");        }        loader = new AppClassLoader(app.getName(), new URL[] { helmajar });    }