Example #1
0
 void deleteEmptyFolder(OperationContext octxt, int folderId) throws ServiceException {
   lock.lock();
   try {
     Folder folder = getFolderById(octxt, folderId);
     if (folder.getItemCount() != 0 || folder.hasSubfolders()) {
       throw OfflineServiceException.FOLDER_NOT_EMPTY(folderId);
     }
     delete(octxt, folderId, MailItem.Type.FOLDER);
   } catch (MailServiceException.NoSuchItemException nsie) {
     ZimbraLog.mailbox.info("folder already deleted, skipping: %d", folderId);
   } finally {
     lock.release();
   }
 }
Example #2
0
 public Element proxyRequest(
     Element request, SoapProtocol resProto, boolean quietWhenOffline, String op)
     throws ServiceException {
   if (!OfflineSyncManager.getInstance().isConnectionDown()) {
     try {
       return sendRequest(
           request, true, true, OfflineLC.zdesktop_request_timeout.intValue(), resProto);
     } catch (ServiceException e) {
       if (!OfflineSyncManager.isConnectionDown(e)) throw e;
     }
   }
   if (quietWhenOffline) {
     OfflineLog.offline.debug(op + " is unavailable when offline");
     return null;
   } else {
     throw OfflineServiceException.ONLINE_ONLY_OP(op);
   }
 }