System.out.println(mProv.createCalendarResource(args[1], getMap(args, 2)).getId());
System.out.println(mProv.createCalendarResource(args[1], args[2].equals("")? null : args[2], getMap(args, 3)).getId());
    private boolean execute(String args[]) throws ServiceException, ArgException, IOException {        String [] members;                mCommand = lookupCommand(args[0]);                if (mCommand == null)            return false;                if (!mCommand.checkArgsLength(args)) {            usage();            return true;        }                switch(mCommand) {        case ADD_ACCOUNT_ALIAS:            mProv.addAlias(lookupAccount(args[1]), args[2]);            break;        case AUTO_COMPLETE_GAL:            doAutoCompleteGal(args);             break;                    case CREATE_ACCOUNT:            System.out.println(mProv.createAccount(args[1], args[2].equals("")? null : args[2], getMap(args, 3)).getId());            break;                                case CREATE_COS:            System.out.println(mProv.createCos(args[1], getMap(args, 2)).getId());            break;                case CREATE_DOMAIN:            System.out.println(mProv.createDomain(args[1], getMap(args, 2)).getId());            break;        case CREATE_SERVER:            System.out.println(mProv.createServer(args[1], getMap(args, 2)).getId());            break;                    case EXIT:            System.exit(0);            break;        case GENERATE_DOMAIN_PRE_AUTH_KEY:            doGenerateDomainPreAuthKey(args);            break;        case GENERATE_DOMAIN_PRE_AUTH:            doGenerateDomainPreAuth(args);            break;                    case GET_ACCOUNT:            dumpAccount(lookupAccount(args[1]));            break;        case GET_ACCOUNT_MEMBERSHIP:            doGetAccountMembership(args);            break;        case GET_ALL_ACCOUNTS:            doGetAllAccounts(args);             break;                    case GET_ALL_ADMIN_ACCOUNTS:            doGetAllAdminAccounts(args);            break;                                case GET_ALL_CONFIG:            dumpAttrs(mProv.getConfig().getAttrs());                        break;                    case GET_ALL_COS:            doGetAllCos(args);             break;                                case GET_ALL_DOMAINS:            doGetAllDomains(args);             break;                                case GET_ALL_SERVERS:            doGetAllServers(args);             break;        case GET_CONFIG:            doGetConfig(args);             break;                                case GET_COS:            dumpCos(lookupCos(args[1]));            break;        case GET_DISTRIBUTION_LIST_MEMBERSHIP:            doGetDistributionListMembership(args);            break;                    case GET_DOMAIN:            dumpDomain(lookupDomain(args[1]));            break;                                case GET_SERVER:            dumpServer(lookupServer(args[1]));            break;        case HELP:            doHelp(args);             break;                    case MODIFY_ACCOUNT:            mProv.modifyAttrs(lookupAccount(args[1]), getMap(args,2), true);            break;                    case MODIFY_COS:            mProv.modifyAttrs(lookupCos(args[1]), getMap(args, 2), true);                        break;                    case MODIFY_CONFIG:            mProv.modifyAttrs(mProv.getConfig(), getMap(args, 1), true);                        break;                                case MODIFY_DOMAIN:            mProv.modifyAttrs(lookupDomain(args[1]), getMap(args, 2), true);                        break;                    case MODIFY_SERVER:            mProv.modifyAttrs(lookupServer(args[1]), getMap(args, 2), true);                        break;                    case DELETE_ACCOUNT:            mProv.deleteAccount(lookupAccount(args[1]).getId());            break;                    case DELETE_COS:            mProv.deleteCos(lookupCos(args[1]).getId());            break;                    case DELETE_DOMAIN:            mProv.deleteDomain(lookupDomain(args[1]).getId());                        break;                    case DELETE_SERVER:            mProv.deleteServer(lookupServer(args[1]).getId());            break;        case REMOVE_ACCOUNT_ALIAS:            mProv.removeAlias(lookupAccount(args[1]), args[2]);            break;                    case RENAME_ACCOUNT:            mProv.renameAccount(lookupAccount(args[1]).getId(), args[2]);                        break;                                case RENAME_COS:            mProv.renameCos(lookupCos(args[1]).getId(), args[2]);                        break;                                            case SET_ACCOUNT_COS:            mProv.setCOS(lookupAccount(args[1]),lookupCos(args[2]));             break;                                case SEARCH_ACCOUNTS:            doSearchAccounts(args);             break;                                            case SEARCH_GAL:            doSearchGal(args);             break;        case SYNC_GAL:            doSyncGal(args);            break;        case SET_PASSWORD:            mProv.setPassword(lookupAccount(args[1]), args[2]);            break;        case CREATE_DISTRIBUTION_LIST:            System.out.println(mProv.createDistributionList(args[1], getMap(args, 2)).getId());            break;        case CREATE_DISTRIBUTION_LISTS_BULK:            doCreateDistributionListsBulk(args);                        break;                    case GET_ALL_DISTRIBUTION_LISTS:            doGetAllDistributionLists(args);            break;        case GET_DISTRIBUTION_LIST:            dumpDistributionList(lookupDistributionList(args[1]));            break;        case MODIFY_DISTRIBUTION_LIST:            mProv.modifyAttrs(lookupDistributionList(args[1]), getMap(args, 2), true);            break;        case DELETE_DISTRIBUTION_LIST:            mProv.deleteDistributionList(lookupDistributionList(args[1]).getId());            break;        case ADD_DISTRIBUTION_LIST_MEMBER:            members = new String[args.length - 2];            System.arraycopy(args, 2, members, 0, args.length - 2);            mProv.addMembers(lookupDistributionList(args[1]), members);            break;        case REMOVE_DISTRIBUTION_LIST_MEMBER:            members = new String[args.length - 2];            System.arraycopy(args, 2, members, 0, args.length - 2);            mProv.removeMembers(lookupDistributionList(args[1]), members);            break;        case CREATE_BULK_ACCOUNTS:            doCreateAccountsBulk(args);            break;        case ADD_DISTRIBUTION_LIST_ALIAS:            mProv.addAlias(lookupDistributionList(args[1]), args[2]);            break;        case REMOVE_DISTRIBUTION_LIST_ALIAS:            mProv.removeAlias(lookupDistributionList(args[1]), args[2]);            break;        case RENAME_DISTRIBUTION_LIST:            mProv.renameDistributionList(lookupDistributionList(args[1]).getId(), args[2]);            break;        case CREATE_CALENDAR_RESOURCE:            System.out.println(mProv.createCalendarResource(args[1], getMap(args, 2)).getId());            break;        case DELETE_CALENDAR_RESOURCE:            mProv.deleteCalendarResource(lookupCalendarResource(args[1]).getId());            break;        case MODIFY_CALENDAR_RESOURCE:            mProv.modifyAttrs(lookupCalendarResource(args[1]), getMap(args, 2), true);            break;        case RENAME_CALENDAR_RESOURCE:            mProv.renameCalendarResource(lookupCalendarResource(args[1]).getId(), args[2]);            break;        case GET_CALENDAR_RESOURCE:            dumpCalendarResource(lookupCalendarResource(args[1]));            break;        case GET_ALL_CALENDAR_RESOURCES:            doGetAllCalendarResources(args);            break;        case SEARCH_CALENDAR_RESOURCES:            doSearchCalendarResources(args);            break;        case INIT_NOTEBOOK:            initNotebook(args);            break;        case INIT_DOMAIN_NOTEBOOK:            initDomainNotebook(args);            break;        case IMPORT_NOTEBOOK:            importNotebook(args);            break;        case GET_QUOTA_USAGE:            doGetQuotaUsage(args);            break;        case GET_MAILBOX_INFO:            doGetMailboxInfo(args);            break;        case SELECT_MAILBOX:            if (!(mProv instanceof SoapProvisioning))                throw ServiceException.INVALID_REQUEST("can only be used via SOAP", null);             ZMailboxUtil util = new ZMailboxUtil();             util.setVerbose(mVerbose);             util.setDebug(mDebug);             boolean smInteractive = mInteractive && args.length < 3;             util.setInteractive(smInteractive);             util.selectMailbox(args[1], (SoapProvisioning) mProv);             if (smInteractive) {                 util.interactive(mReader);             } else if (args.length > 2){                 String newArgs[] = new String[args.length-2];                 System.arraycopy(args, 2, newArgs, 0, newArgs.length);                 util.execute(newArgs);             } else {                 throw ZClientException.CLIENT_ERROR("command only valid in interactive mode or with arguments", null);             }            break;        case SOAP:            // HACK FOR NOW            SoapProvisioning sp = new SoapProvisioning();            sp.soapSetURI("https://localhost:7071"+ZimbraServlet.ADMIN_SERVICE_URI);            sp.soapZimbraAdminAuthenticate();            mProv = sp;            break;        case LDAP:            // HACK FOR NOW            mProv = Provisioning.getInstance();            break;                    default:            return false;        }        return true;    }