Package helma.util

Examples of helma.util.ResourceProperties


            repositories.add(repository);
        }
        lowerCaseName = name.toLowerCase();

        // Create and register type properties file
        props = new ResourceProperties(app);
        if (typeProps != null) {
            props.putAll(typeProps);
        } else if (repository != null) {
            props.addResource(repository.getResource("type.properties"));
            props.addResource(repository.getResource(name + ".properties"));
View Full Code Here


        if (hopHome == null) {
            throw new RuntimeException("helma.home property not set");
        }

        // create system properties
        sysProps = new ResourceProperties();
        if (config.hasPropFile()) {
            sysProps.addResource(new FileResource(config.getPropFile()));
        }
    }
View Full Code Here

        parseArgs(config, args);

        guessConfig(config);

        // create system properties
        ResourceProperties sysProps = new ResourceProperties();
        sysProps.addResource(new FileResource(config.getPropFile()));

        // check if there's a property setting for those ports not specified via command line
        if (!config.hasWebsrvPort() && sysProps.getProperty("webPort") != null) {
            try {
                config.setWebsrvPort(getInetSocketAddress(sysProps.getProperty("webPort")));
            } catch (Exception portx) {
                throw new Exception("Error parsing web server port property from server.properties: " + portx);
            }
        }

        if (!config.hasAjp13Port() && sysProps.getProperty("ajp13Port") != null) {
            try {
                config.setAjp13Port(getInetSocketAddress(sysProps.getProperty("ajp13Port")));
            } catch (Exception portx) {
                throw new Exception("Error parsing AJP1.3 server port property from server.properties: " + portx);
            }
        }

        if (!config.hasXmlrpcPort() && sysProps.getProperty("xmlrpcPort") != null) {
            try {
                config.setXmlrpcPort(getInetSocketAddress(sysProps.getProperty("xmlrpcPort")));
            } catch (Exception portx) {
                throw new Exception("Error parsing XML-RPC server port property from server.properties: " + portx);
            }
        }
        return config;
View Full Code Here

                config.setPropFile(new File("server.properties"));
            }
        }

        // create system properties
        ResourceProperties sysProps = new ResourceProperties();
        sysProps.addResource(new FileResource(config.getPropFile()));

        // try to get hopHome from property file
        if (!config.hasHomeDir() && sysProps.getProperty("hophome") != null) {
            config.setHomeDir(new File(sysProps.getProperty("hophome")));
        }

        // use the directory where server.properties is located:
        if (!config.hasHomeDir() && config.hasPropFile()) {
            config.setHomeDir(config.getPropFile().getAbsoluteFile().getParentFile());
View Full Code Here

            file = new File(dbPropfile);
        } else {
            file = new File(hopHome, "db.properties");
        }

        dbProps = new ResourceProperties();
        dbProps.setIgnoreCase(false);
        dbProps.addResource(new FileResource(file));
        DbSource.setDefaultProps(dbProps);

        // read apps.properties file
        String appsPropfile = sysProps.getProperty("appsPropFile");
        if ((appsPropfile != null) && !"".equals(appsPropfile.trim())) {
            file = new File(appsPropfile);
        } else {
            file = new File(hopHome, "apps.properties");
        }
        appsProps = new ResourceProperties();
        appsProps.setIgnoreCase(true);
        appsProps.addResource(new FileResource(file));

        paranoid = "true".equalsIgnoreCase(sysProps.getProperty("paranoid"));
View Full Code Here

        /**
         * Creates an AppDescriptor from the properties.
         * @param name the application name
         */
        AppDescriptor(String name) {
            ResourceProperties conf = props.getSubProperties(name + '.');
            appName = name;
            mountpoint = getMountpoint(conf.getProperty("mountpoint", appName));
            pathPattern = getPathPattern(mountpoint);
            staticDir = conf.getProperty("static");
            staticMountpoint = getPathPattern(conf.getProperty("staticMountpoint",
                                        joinMountpoint(mountpoint, "static")));
            staticIndex = "true".equalsIgnoreCase(conf.getProperty("staticIndex"));
            String home = conf.getProperty("staticHome");
            if (home == null) {
                staticHome = new String[] {"index.html", "index.htm"};
            } else {
                staticHome = StringUtils.split(home, ",");
            }
            protectedStaticDir = conf.getProperty("protectedStatic");

            cookieDomain = conf.getProperty("cookieDomain");
            sessionCookieName = conf.getProperty("sessionCookieName");
            protectedSessionCookie = conf.getProperty("protectedSessionCookie");
            uploadLimit = conf.getProperty("uploadLimit");
            uploadSoftfail = conf.getProperty("uploadSoftfail");
            debug = conf.getProperty("debug");
            String appDirName = conf.getProperty("appdir");
            appDir = (appDirName == null) ? null : getAbsoluteFile(appDirName);
            String dbDirName = conf.getProperty("dbdir");
            dbDir = (dbDirName == null) ? null : getAbsoluteFile(dbDirName);
            servletClassName = conf.getProperty("servletClass");

            // got ignore dirs
            ignoreDirs = conf.getProperty("ignore");

            // read and configure app repositories
            ArrayList repositoryList = new ArrayList();
            Class[] parameters = { String.class };
            for (int i = 0; true; i++) {
                String repositoryArgs = conf.getProperty("repository." + i);

                if (repositoryArgs != null) {
                    // lookup repository implementation
                    String repositoryImpl = conf.getProperty("repository." + i +
                                                              ".implementation");
                    if (repositoryImpl == null) {
                        // implementation not set manually, have to guess it
                        if (repositoryArgs.endsWith(".zip")) {
                            repositoryArgs = findResource(repositoryArgs);
View Full Code Here

        // lazy initialization of extensionMap
        if (extID == null) {
            return;
        }
        if (extensionMap == null) {
            extensionMap = new ResourceProperties();
            extensionMap.setIgnoreCase(true);
        } else if (extensionMap.containsValue(extName)) {
            // remove any preexisting mapping for the given childmapping
            extensionMap.values().remove(extName);
        }
View Full Code Here

     * @return the old properties
     * @throws ClassNotFoundException if jdbc driver class couldn't be found
     */
    public synchronized ResourceProperties switchProperties(ResourceProperties newProps)
            throws ClassNotFoundException {
        ResourceProperties oldProps = props;
        props = newProps;
        init();
        return oldProps;
    }
View Full Code Here

TOP

Related Classes of helma.util.ResourceProperties

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.