use of com.zimbra.client.ZMailbox.OwnerBy in project zm-mailbox by Zimbra.
the class ZMailboxUtil method doCreateMountpoint.
private void doCreateMountpoint(String[] args) throws ServiceException {
String cmPath = args[0];
String cmOwner = args[1];
String cmItem = args[2];
boolean reminderEnabled = paramb(args, 3, false);
OwnerBy ownerBy = OwnerBy.BY_NAME;
if (StringUtil.isUUID(cmOwner)) {
ownerBy = OwnerBy.BY_ID;
}
SharedItemBy sharedItemBy = SharedItemBy.BY_PATH;
String sharedItem = cmItem;
int colonAt = cmItem.indexOf(':');
if (colonAt != -1 && colonAt != 0 && colonAt != cmItem.length() - 1) {
String itemOwnerId = cmItem.substring(0, colonAt);
String itemId = cmItem.substring(colonAt + 1);
if (StringUtil.isUUID(itemOwnerId)) {
sharedItemBy = SharedItemBy.BY_ID;
sharedItem = itemId;
}
}
ZMountpoint cm = mMbox.createMountpoint(lookupFolderId(cmPath, true), ZMailbox.getBasePath(cmPath), folderViewOpt(), folderColorOpt(), flagsOpt(), ownerBy, cmOwner, sharedItemBy, sharedItem, reminderEnabled);
stdout.println(cm.getId());
}
Aggregations