Package org.apache.james.managesieve.api

Examples of org.apache.james.managesieve.api.ScriptNotFoundException


            ScriptNotFoundException {
        String script;
        try {
            script = toString(getScriptFile(user, name), UTF_8);
        } catch (FileNotFoundException ex) {
            throw new ScriptNotFoundException(ex);
        }
        return script;
    }
View Full Code Here


            ScriptNotFoundException {
        String script;
        try {
            script = toString(getActiveFile(user), UTF_8);
        } catch (FileNotFoundException ex) {
            throw new ScriptNotFoundException(ex);
        }
        return script;
    }
View Full Code Here

        File dir = getUserDirectory(user);
        String content;
        try {
            content = toString(new File(dir, FILE_NAME_ACTIVE), UTF_8);
        } catch (FileNotFoundException ex) {
            throw new ScriptNotFoundException("There is no active script.");
        }
        return new File(dir, content);
    }
View Full Code Here

    protected File getScriptFile(String user, String name) throws UserNotFoundException,
            ScriptNotFoundException {
        File file = new File(getUserDirectory(user), name);
        if (!file.exists()) {
            throw new ScriptNotFoundException("User: " + user + "Script: " + name);
        }
        return file;
    }
View Full Code Here

            throw new UserNotFoundException(user);
        }
        SieveScript script = _repository.get(user).get(name);
        if (null == script)
        {
            throw new ScriptNotFoundException(name);
        }
        if (script.isActive())
        {
            throw new IsActiveException(name);
        }
View Full Code Here

                break;
            }
        }
        if (null == content)
        {
            throw new ScriptNotFoundException();
        }
        return content;
    }
View Full Code Here

            throw new UserNotFoundException(user);
        }
        SieveScript script = _repository.get(user).get(name);
        if (null == script)
        {
            throw new ScriptNotFoundException(name);
        }
        return script.getContent();
    }
View Full Code Here

                _repository.get(user).get(name).setActive(true);
            } else {
                if (null != oldActive) {
                    oldActive.getValue().setActive(true);
                }
                throw new ScriptNotFoundException();
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.james.managesieve.api.ScriptNotFoundException

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.