Search in sources :

Example 1 with SharedItemBy

use of com.zimbra.client.ZMailbox.SharedItemBy 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());
}
Also used : OwnerBy(com.zimbra.client.ZMailbox.OwnerBy) ZMountpoint(com.zimbra.client.ZMountpoint) SharedItemBy(com.zimbra.client.ZMailbox.SharedItemBy) ZMountpoint(com.zimbra.client.ZMountpoint)

Aggregations

OwnerBy (com.zimbra.client.ZMailbox.OwnerBy)1 SharedItemBy (com.zimbra.client.ZMailbox.SharedItemBy)1 ZMountpoint (com.zimbra.client.ZMountpoint)1