Package com.cubusmail.server.mail.exceptions

Examples of com.cubusmail.server.mail.exceptions.MailFolderException


        Folder newFolder = this.store.getFolder( newFolderName );
        if ( !newFolder.exists() ) {
          sourceFolder.renameTo( newFolder );
        }
        else {
          throw new MailFolderException( IErrorCodes.EXCEPTION_FOLDER_ALREADY_EXIST, null, sourceFolder );
        }
        loadMailFolder();

        return createMailFolder( newFolder );
      }
    }
    catch (MessagingException e) {
      throw new MailFolderException( IErrorCodes.EXCEPTION_FOLDER_MOVE, e, sourceFolder );
    }

    return null;
  }
View Full Code Here


        folder.close( false );
      }
      Folder newFolder = this.store.getFolder( newName );
      if ( !newFolder.exists() ) {
        if ( !folder.renameTo( newFolder ) ) {
          throw new MailFolderException( IErrorCodes.EXCEPTION_FOLDER_RENAME, null, folder );
        }
      }
      else {
        throw new MailFolderException( IErrorCodes.EXCEPTION_FOLDER_ALREADY_EXIST, null,
            createMailFolder( newFolder ) );
      }
      loadMailFolder();
      return createMailFolder( newFolder );
    }
    catch (MessagingException ex) {
      throw new MailFolderException( IErrorCodes.EXCEPTION_FOLDER_RENAME, ex, folder );
    }
  }
View Full Code Here

        }
      }
      folder.close( true );
    }
    catch (MessagingException ex) {
      throw new MailFolderException( IErrorCodes.EXCEPTION_FOLDER_EMPTY, ex, folder );
    }
  }
View Full Code Here

        if ( folder.delete( true ) ) {
          loadMailFolder();
          setCurrentFolder( getInboxFolder() );
        }
        else {
          throw new MailFolderException( IErrorCodes.EXCEPTION_FOLDER_DELETE, null, folder );
        }
      }
    }
    catch (MessagingException ex) {
      throw new MailFolderException( IErrorCodes.EXCEPTION_FOLDER_DELETE, ex, folder );
    }
  }
View Full Code Here

      Folder newFolder = this.store.getFolder( newFolderName );
      if ( !newFolder.exists() ) {
        log.debug( "Creating folder... " + newFolderName );
        boolean success = newFolder.create( Folder.HOLDS_MESSAGES );
        if ( !success ) {
          throw new MailFolderException( IErrorCodes.EXCEPTION_FOLDER_CREATE, null );
        }
        newFolder.setSubscribed( true );
      }
      else {
        throw new MailFolderException( IErrorCodes.EXCEPTION_FOLDER_ALREADY_EXIST, null );
      }
      loadMailFolder();

      return createMailFolder( newFolder );
    }
    catch (MessagingException ex) {
      throw new MailFolderException( IErrorCodes.EXCEPTION_FOLDER_CREATE, ex );
    }
  }
View Full Code Here

TOP

Related Classes of com.cubusmail.server.mail.exceptions.MailFolderException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.