Package org.apache.commons.collections

Examples of org.apache.commons.collections.ExtendedProperties.load()


            for (String prop : includes.split(",")) {
                File prop_file = (prop.startsWith("/")) ? new File(prop) : new File(_webInfDir, prop);
                try {
                    is = new BufferedInputStream(new FileInputStream(prop_file));
                    ExtendedProperties p = new ExtendedProperties();
                    p.load(is);
                    _properties.combine(p);
                } catch (Exception e) {
                    // ignore
                } finally {
                    try {
View Full Code Here


            // Load the wiring properties
            File moduleWirings = absolutize(_homeDir, _properties.getString("butterfly.modules.wirings","WEB-INF/modules.properties"));
            _logger.info("Loaded module wirings from: {}", moduleWirings);
            _classLoader.watch(moduleWirings); // reload if the module wirings change
            FileInputStream fis = new FileInputStream(moduleWirings);
            wirings.load(fis);
            fis.close();
        } catch (Exception e) {
            _configurationException = new Exception("Failed to load module wirings", e);
        }
        _logger.info("< load module wirings");
View Full Code Here

                ExtendedProperties p  = new ExtendedProperties();
                File propFile = new File(modFile,"module.properties");
                if (propFile.exists()) {
                    _classLoader.watch(propFile); // reload if the the module properties change
                    BufferedInputStream stream = new BufferedInputStream(new FileInputStream(propFile));
                    p.load(stream);
                    stream.close();
                }

                p.addProperty(PATH_PROP, f.getAbsolutePath());
               
View Full Code Here

        }

        ExtendedProperties properties = new ExtendedProperties();
        try
        {
            properties.load(inputStream);
        }
        catch (IOException ioe)
        {
            String msg = "Failed to load properties at: "+path;
            getLog().error(msg, ioe);
View Full Code Here

        }
       
        ExtendedProperties p = new ExtendedProperties();
        if (propsFile != null)
        {
            p.load(servletContext.getResourceAsStream(propsFile));

            Velocity.info("Custom Properties File: "+propsFile);
        }
        else
        {
View Full Code Here

        {
            inputStream = getClass()
                    .getResourceAsStream(DEFAULT_TOOLS_PROPERTIES);
            if (inputStream != null)
            {
                defaultProperties.load(inputStream);
            }
        }
        catch (IOException ioe)
        {
            log("Cannot load default extendedProperties!", ioe);
View Full Code Here

        ExtendedProperties p = new ExtendedProperties();
        InputStream is = getServletContext().getResourceAsStream(propsFile);
        if (is != null)
        {
            // load the properties from the input stream
            p.load(is);
            velocity.info("VelocityViewServlet: Using custom properties at '"
                          + propsFile + "'");
        }
        else
        {
View Full Code Here

                        + "/config/dspace-solr-search.cfg");
                if (config.exists()) {
                    props.combine(new ExtendedProperties(config.getAbsolutePath()));
                } else {
                    ExtendedProperties defaults = new ExtendedProperties();
                    defaults.load(SolrServiceImpl.class.getResourceAsStream("dspace-solr-search.cfg"));
                    props.combine(defaults);
                }
            } catch (Exception e) {
                log.error(e.getMessage(), e);
            }
View Full Code Here

            {
                // resolve relative path from basedir and leave
                // absolute path untouched.
                File fullPath = project.resolveFile(sources[i]);
                log("Using contextProperties file: " + fullPath);
                source.load(new FileInputStream(fullPath));
            }
            catch (IOException e)
            {
                ClassLoader classLoader = this.getClass().getClassLoader();
View Full Code Here

                        throw new BuildException("Context properties file " + sources[i] +
                            " could not be found in the file system or on the classpath!");
                    }
                    else
                    {
                        source.load(inputStream);
                    }
                }
                catch (IOException ioe)
                {
                    source = null;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.