protected Object executeBasic()

in core/src/main/java/org/apache/jsieve/commands/optional/FileInto.java [59:80]


    protected Object executeBasic(MailAdapter mail, Arguments arguments,
            Block block, SieveContext context) throws SieveException {
        final String destination = ((StringListArgument) arguments
                .getArgumentList().get(0)).getList().get(0);

        // Only one fileinto per destination allowed, others should be
        // discarded
        boolean isDuplicate = false;
        for (final Action action: mail.getActions()) {
            isDuplicate = (action instanceof ActionFileInto)
                    && (((ActionFileInto) action).getDestination()
                            .equals(destination));
            if (isDuplicate) {
                break;
            }
        }

        if (!isDuplicate)
            mail.addAction(new ActionFileInto(destination));

        return null;
    }