use of com.zimbra.client.ZGetInfoResult in project zm-mailbox by Zimbra.
the class TestUtil method createMountpoint.
/**
* Creates a mountpoint between two mailboxes. The mountpoint gives the "to" user full rights on the folder.
*
* @param remoteMbox
* remote mailbox
* @param remotePath
* remote folder path. Folder is created if it doesn't exist.
* @param localMbox
* local mailbox
* @param mountpointName
* the name of the mountpoint folder. The folder is created directly under the user root.
*/
public static ZMountpoint createMountpoint(ZMailbox remoteMbox, String remotePath, ZMailbox localMbox, String mountpointName) throws ServiceException {
ZFolder remoteFolder = remoteMbox.getFolderByPath(remotePath);
if (remoteFolder == null) {
remoteFolder = createFolder(remoteMbox, remotePath);
}
ZGetInfoResult remoteInfo = remoteMbox.getAccountInfo(true);
remoteMbox.modifyFolderGrant(remoteFolder.getId(), GranteeType.all, null, "rwidx", null);
return localMbox.createMountpoint(Integer.toString(Mailbox.ID_FOLDER_USER_ROOT), mountpointName, null, null, null, OwnerBy.BY_ID, remoteInfo.getId(), SharedItemBy.BY_ID, remoteFolder.getId(), false);
}
use of com.zimbra.client.ZGetInfoResult 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.
}
}
Aggregations