Package org.apache.velocity.tools.config

Examples of org.apache.velocity.tools.config.FileFactoryConfiguration


        {
            return null;
        }

        // then make sure it's a file type we recognize
        FileFactoryConfiguration config = null;
        if (path.endsWith(".xml"))
        {
            config = new XmlFactoryConfiguration(this.deprecationSupportMode);
        }
        else if (path.endsWith(".properties"))
        {
            config = new PropertiesFactoryConfiguration();
        }
        else
        {
            String msg = "Unknown configuration file type: " + path +
                         "\nOnly .xml and .properties configuration files are supported at this time.";
            getLog().debug(msg);
            if (required)
            {
                throw new UnsupportedOperationException(msg);
            }
        }

        // now, try to read the file
        try
        {
            config.read(inputStream);
        }
        catch (IOException ioe)
        {
            String msg = "Failed to load configuration at: "+path;
            getLog().error(msg, ioe);
View Full Code Here


        return this.application;
    }

    protected FactoryConfiguration getConfiguration(String path)
    {
        FileFactoryConfiguration config = null;
        if (path.endsWith(".xml"))
        {
            config = new XmlFactoryConfiguration();
        }
        else if (path.endsWith(".properties"))
        {
            config = new PropertiesFactoryConfiguration();
        }
        else
        {
            String msg = "Unknown configuration file type: " + path +
                         "\nOnly .xml and .properties configuration files are supported at this time.";
            throw new UnsupportedOperationException(msg);
        }

        // now, try to read the file
        InputStream inputStream = getInputStream(path);
        try
        {
            config.read(inputStream);
        }
        catch (IOException ioe)
        {
            throw new RuntimeException("Failed to load configuration at: "+path, ioe);
        }
View Full Code Here

        {
            return null;
        }

        // then make sure it's a file type we recognize
        FileFactoryConfiguration config = null;
        if (path.endsWith(".xml"))
        {
            config = new XmlFactoryConfiguration(this.deprecationSupportMode);
        }
        else if (path.endsWith(".properties"))
        {
            config = new PropertiesFactoryConfiguration();
        }
        else
        {
            String msg = "Unknown configuration file type: " + path +
                         "\nOnly .xml and .properties configuration files are supported at this time.";
            getLog().debug(msg);
            if (required)
            {
                throw new UnsupportedOperationException(msg);
            }
            else
            {
                return null;
            }
        }

        // now, try to read the file
        try
        {
            config.read(inputStream);
        }
        catch (IOException ioe)
        {
            String msg = "Failed to load configuration at: "+path;
            getLog().error(msg, ioe);
View Full Code Here

        {
            return null;
        }

        // then make sure it's a file type we recognize
        FileFactoryConfiguration config = null;
        String source = "ServletUtils.getConfiguration("+path+",ServletContext[,depMode="+deprecationSupportMode+"])";
        if (path.endsWith(".xml"))
        {
            config = new XmlFactoryConfiguration(deprecationSupportMode, source);
        }
        else if (path.endsWith(".properties"))
        {
            config = new PropertiesFactoryConfiguration(source);
        }
        else
        {
            String msg = "Unknown configuration file type: " + path +
                         "\nOnly .xml and .properties configuration files are supported at this time.";
            throw new UnsupportedOperationException(msg);
        }

        // now, try to read the file
        try
        {
            config.read(inputStream);
        }
        catch (IOException ioe)
        {
            throw new RuntimeException("Failed to load configuration at: "+path, ioe);
        }
View Full Code Here

        {
            return null;
        }

        // then make sure it's a file type we recognize
        FileFactoryConfiguration config = null;
        String source = "VelocityView.getConfiguration("+path+","+required+")";
        if (path.endsWith(".xml"))
        {
            config = new XmlFactoryConfiguration(this.deprecationSupportMode, source);
        }
        else if (path.endsWith(".properties"))
        {
            config = new PropertiesFactoryConfiguration(source);
        }
        else
        {
            String msg = "Unknown configuration file type: " + path +
                         "\nOnly .xml and .properties configuration files are supported at this time.";
            getLog().debug(msg);
            if (required)
            {
                throw new UnsupportedOperationException(msg);
            }
            else
            {
                return null;
            }
        }

        // now, try to read the file
        try
        {
            config.read(inputStream);
        }
        catch (IOException ioe)
        {
            String msg = "Failed to load configuration at: "+path;
            getLog().error(msg, ioe);
View Full Code Here

        {
            return null;
        }

        // then make sure it's a file type we recognize
        FileFactoryConfiguration config = null;
        String source = "ServletUtils.getConfiguration("+path+",ServletContext[,depMode])";
        if (path.endsWith(".xml"))
        {
            config = new XmlFactoryConfiguration(deprecationSupportMode, source);
        }
        else if (path.endsWith(".properties"))
        {
            config = new PropertiesFactoryConfiguration(source);
        }
        else
        {
            String msg = "Unknown configuration file type: " + path +
                         "\nOnly .xml and .properties configuration files are supported at this time.";
            throw new UnsupportedOperationException(msg);
        }

        // now, try to read the file
        try
        {
            config.read(inputStream);
        }
        catch (IOException ioe)
        {
            throw new RuntimeException("Failed to load configuration at: "+path, ioe);
        }
View Full Code Here

        {
            return null;
        }

        // then make sure it's a file type we recognize
        FileFactoryConfiguration config = null;
        String source = "ServletUtils.getConfiguration("+path+",ServletContext[,depMode])";
        if (path.endsWith(".xml"))
        {
            config = new XmlFactoryConfiguration(deprecationSupportMode, source);
        }
        else if (path.endsWith(".properties"))
        {
            config = new PropertiesFactoryConfiguration(source);
        }
        else
        {
            String msg = "Unknown configuration file type: " + path +
                         "\nOnly .xml and .properties configuration files are supported at this time.";
            throw new UnsupportedOperationException(msg);
        }

        // now, try to read the file
        try
        {
            config.read(inputStream);
        }
        catch (IOException ioe)
        {
            throw new RuntimeException("Failed to load configuration at: "+path, ioe);
        }
View Full Code Here

TOP

Related Classes of org.apache.velocity.tools.config.FileFactoryConfiguration

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.