Search in sources :

Example 1 with ZSignature

use of com.zimbra.client.ZSignature in project zm-mailbox by Zimbra.

the class TestZClient method testModifySignatures.

/**
     * Confirms that the {@code List} of signatures returned by {@link ZMailbox#getSignatures}
     * is modifiable (see bug 51842). 
     */
public void testModifySignatures() throws Exception {
    ZMailbox mbox = TestUtil.getZMailbox(USER_NAME);
    List<ZSignature> signatures = mbox.getSignatures();
    try {
        signatures.set(signatures.size(), null);
    } catch (IndexOutOfBoundsException e) {
    // Not UnsupportedOperationException, so we're good.
    }
    ZGetInfoResult info = mbox.getAccountInfo(true);
    signatures = info.getSignatures();
    try {
        signatures.set(signatures.size(), null);
    } catch (IndexOutOfBoundsException e) {
    // Not UnsupportedOperationException, so we're good.
    }
}
Also used : ZMailbox(com.zimbra.client.ZMailbox) ZGetInfoResult(com.zimbra.client.ZGetInfoResult) ZSignature(com.zimbra.client.ZSignature)

Example 2 with ZSignature

use of com.zimbra.client.ZSignature in project zm-mailbox by Zimbra.

the class ZMailboxUtil method doModifySignature.

private void doModifySignature(String[] args) throws ServiceException {
    ZSignature sig = lookupSignature(args[0]);
    ZSignature modSig = new ZSignature(sig.getId(), sig.getName(), args[1]);
    mMbox.modifySignature(modSig);
}
Also used : ZSignature(com.zimbra.client.ZSignature)

Example 3 with ZSignature

use of com.zimbra.client.ZSignature in project zm-mailbox by Zimbra.

the class ZMailboxUtil method dumpSignatures.

private void dumpSignatures(List<ZSignature> signatures) {
    if (verboseOpt()) {
        stdout.println("[");
        boolean first = true;
        for (ZSignature sig : signatures) {
            if (first)
                first = false;
            else
                stdout.println(",");
            stdout.println(sig.dump());
        }
        stdout.println("]");
    } else {
        if (signatures.size() == 0)
            return;
        for (ZSignature sig : signatures) {
            stdout.println(sig.getName());
        }
    }
}
Also used : ZSignature(com.zimbra.client.ZSignature)

Example 4 with ZSignature

use of com.zimbra.client.ZSignature in project zm-mailbox by Zimbra.

the class ZMailboxUtil method doCreateSignature.

private void doCreateSignature(String[] args) throws ServiceException {
    ZSignature sig = new ZSignature(args[0], args[1]);
    stdout.println(mMbox.createSignature(sig));
}
Also used : ZSignature(com.zimbra.client.ZSignature)

Example 5 with ZSignature

use of com.zimbra.client.ZSignature in project zm-mailbox by Zimbra.

the class ZMailboxUtil method doRenameSignature.

private void doRenameSignature(String[] args) throws ServiceException {
    ZSignature sig = lookupSignature(args[0]);
    ZSignature modSig = new ZSignature(sig.getId(), args[1], sig.getValue());
    mMbox.modifySignature(modSig);
}
Also used : ZSignature(com.zimbra.client.ZSignature)

Aggregations

ZSignature (com.zimbra.client.ZSignature)5 ZGetInfoResult (com.zimbra.client.ZGetInfoResult)1 ZMailbox (com.zimbra.client.ZMailbox)1