Package org.apache.jsieve

Examples of org.apache.jsieve.ConfigurationManager


     * @throws SieveException
     * @throws ParseException
     */
    static public Node parse(String script) throws SieveException,
            ParseException {
        return new ConfigurationManager().build().parse(
                new ByteArrayInputStream(script.getBytes()));
    }
View Full Code Here


            throws IOException, MessagingException {
        MimeMessage mimeMessage = new MimeMessage(null, message);
        adapter.setMail(mimeMessage);
        Results results;
        try {
            new ConfigurationManager().build().interpret(adapter, script);
            final List executedActions = adapter.getExecutedActions();
            results = new Results(executedActions);
        } catch (ParseException e) {
            e.printStackTrace();
            results = new Results(e);
View Full Code Here

        map.put("reject", "org.apache.jsieve.commands.optional.Reject");
        map.put("fileinto", "org.apache.jsieve.commands.optional.FileInto");

        boolean isTestPassed = false;
        try {
            Map commandMap = new ConfigurationManager().getCommandMap();

            Iterator mapIter = map.entrySet().iterator();
            while (mapIter.hasNext()) {
                Map.Entry entry = (Map.Entry) mapIter.next();
                assertTrue("Key: " + entry.getKey(), commandMap
View Full Code Here

        // RFC3082 - Implementations SHOULD support the "envelope" test.
        map.put("envelope", "org.apache.jsieve.tests.optional.Envelope");

        boolean isTestPassed = false;
        try {
            Map testMap = new ConfigurationManager().getTestMap();

            Iterator mapIter = map.entrySet().iterator();
            while (mapIter.hasNext()) {
                Map.Entry entry = (Map.Entry) mapIter.next();
                assertTrue("Key: " + entry.getKey(), testMap.containsKey(entry
View Full Code Here

                .put("i;ascii-casemap",
                        "org.apache.jsieve.comparators.AsciiCasemap");

        boolean isTestPassed = false;
        try {
            Map comparatorMap = new ConfigurationManager().getComparatorMap();

            Iterator mapIter = map.entrySet().iterator();
            while (mapIter.hasNext()) {
                Map.Entry entry = (Map.Entry) mapIter.next();
                assertTrue("Key: " + entry.getKey(), comparatorMap
View Full Code Here

            throws IOException, MessagingException {
        MimeMessage mimeMessage = new MimeMessage(null, message);
        adapter.setMail(mimeMessage);
        Results results;
        try {
            new ConfigurationManager().build().interpret(adapter, script);
            final List executedActions = adapter.getExecutedActions();
            results = new Results(executedActions);
        } catch (ParseException e) {
            e.printStackTrace();
            results = new Results(e);
View Full Code Here

    public void init(MailetConfig config) throws MessagingException {
       
        super.init(config);

        try {
            final ConfigurationManager configurationManager = new ConfigurationManager();
            final int logLevel;
            if (verbose) {
                logLevel = CommonsLoggingAdapter.TRACE;
            } else if (quiet) {
                logLevel = CommonsLoggingAdapter.FATAL;
            } else {
                logLevel = CommonsLoggingAdapter.WARN;
            }
            log = new CommonsLoggingAdapter(this, logLevel);
            configurationManager.setLog(log);
            factory = configurationManager.build();
        } catch (SieveConfigurationException e) {
            throw new MessagingException("Failed to load standard Sieve configuration.", e);
        }
    }
View Full Code Here

    public void init(MailetConfig config) throws MessagingException {
       
        super.init(config);

        try {
            final ConfigurationManager configurationManager = new ConfigurationManager();
            final int logLevel;
            if (verbose) {
                logLevel = CommonsLoggingAdapter.TRACE;
            } else if (quiet) {
                logLevel = CommonsLoggingAdapter.FATAL;
            } else {
                logLevel = CommonsLoggingAdapter.WARN;
            }
            log = new CommonsLoggingAdapter(this, logLevel);
            configurationManager.setLog(log);
            factory = configurationManager.build();
        } catch (SieveConfigurationException e) {
            throw new MessagingException("Failed to load standard Sieve configuration.", e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.jsieve.ConfigurationManager

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.