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.
}
}
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);
}
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());
}
}
}
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));
}
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);
}
Aggregations