net.fortuna.mstor
Class MStorFolder

java.lang.Object
  extended by javax.mail.Folder
      extended by net.fortuna.mstor.MStorFolder
All Implemented Interfaces:
javax.mail.UIDFolder

public final class MStorFolder
extends javax.mail.Folder
implements javax.mail.UIDFolder

A folder implementation for the mstor javamail provider.

Author:
Ben Fortuna
 $Id$

 Created: [6/07/2004]

 Contributors: Paul Legato - fix for expunge() method
 

Nested Class Summary
 
Nested classes/interfaces inherited from interface javax.mail.UIDFolder
javax.mail.UIDFolder.FetchProfileItem
 
Field Summary
 
Fields inherited from class javax.mail.Folder
HOLDS_FOLDERS, HOLDS_MESSAGES, mode, READ_ONLY, READ_WRITE, store
 
Fields inherited from interface javax.mail.UIDFolder
LASTUID
 
Constructor Summary
MStorFolder(MStorStore store, FolderDelegate<? extends MessageDelegate> delegate)
          Constructs a new mstor folder instance.
 
Method Summary
 void appendMessages(javax.mail.Message[] messages)
          Appends the specified messages to this folder.
 void close(boolean expunge)
          
 boolean create(int type)
          
 boolean delete(boolean recurse)
          
 boolean exists()
          
 javax.mail.Message[] expunge()
          
 int getDeletedMessageCount()
          
 javax.mail.Folder getFolder(java.lang.String name)
          
 java.lang.String getFullName()
          
 javax.mail.Message getMessage(int index)
          
 javax.mail.Message getMessageByUID(long uid)
          
 int getMessageCount()
          
 javax.mail.Message[] getMessagesByUID(long[] uids)
          
 javax.mail.Message[] getMessagesByUID(long start, long end)
          
 java.lang.String getName()
          
 javax.mail.Folder getParent()
          
 javax.mail.Flags getPermanentFlags()
          
 char getSeparator()
          
 int getType()
          
 long getUID(javax.mail.Message message)
          
 long getUIDValidity()
          
 boolean hasNewMessages()
          
 boolean isOpen()
          
 javax.mail.Folder[] list(java.lang.String pattern)
          
 void open(int mode)
          
 boolean renameTo(javax.mail.Folder folder)
          
 
Methods inherited from class javax.mail.Folder
addConnectionListener, addFolderListener, addMessageChangedListener, addMessageCountListener, copyMessages, fetch, finalize, getMessages, getMessages, getMessages, getMode, getNewMessageCount, getStore, getUnreadMessageCount, getURLName, isSubscribed, list, listSubscribed, listSubscribed, notifyConnectionListeners, notifyFolderListeners, notifyFolderRenamedListeners, notifyMessageAddedListeners, notifyMessageChangedListeners, notifyMessageRemovedListeners, removeConnectionListener, removeFolderListener, removeMessageChangedListener, removeMessageCountListener, search, search, setFlags, setFlags, setFlags, setSubscribed, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MStorFolder

public MStorFolder(MStorStore store,
                   FolderDelegate<? extends MessageDelegate> delegate)
Constructs a new mstor folder instance.

Parameters:
store - the mail store this folder belongs to
delegate - a folder delegate that provides implementation-specific folder functionality
Method Detail

getName

public java.lang.String getName()

Specified by:
getName in class javax.mail.Folder

getFullName

public java.lang.String getFullName()

Specified by:
getFullName in class javax.mail.Folder

getParent

public javax.mail.Folder getParent()
                            throws javax.mail.MessagingException

Specified by:
getParent in class javax.mail.Folder
Throws:
javax.mail.MessagingException

exists

public boolean exists()
               throws javax.mail.MessagingException

Specified by:
exists in class javax.mail.Folder
Throws:
javax.mail.MessagingException

list

public javax.mail.Folder[] list(java.lang.String pattern)
                         throws javax.mail.MessagingException

Specified by:
list in class javax.mail.Folder
Throws:
javax.mail.MessagingException

getSeparator

public char getSeparator()
                  throws javax.mail.MessagingException

Specified by:
getSeparator in class javax.mail.Folder
Throws:
javax.mail.MessagingException

getType

public int getType()
            throws javax.mail.MessagingException

Specified by:
getType in class javax.mail.Folder
Throws:
javax.mail.MessagingException

create

public boolean create(int type)
               throws javax.mail.MessagingException

Specified by:
create in class javax.mail.Folder
Throws:
javax.mail.MessagingException

hasNewMessages

public boolean hasNewMessages()
                       throws javax.mail.MessagingException

Specified by:
hasNewMessages in class javax.mail.Folder
Throws:
javax.mail.MessagingException

getFolder

public javax.mail.Folder getFolder(java.lang.String name)
                            throws javax.mail.MessagingException

Specified by:
getFolder in class javax.mail.Folder
Throws:
javax.mail.MessagingException

delete

public boolean delete(boolean recurse)
               throws javax.mail.MessagingException

Specified by:
delete in class javax.mail.Folder
Throws:
javax.mail.MessagingException

renameTo

public boolean renameTo(javax.mail.Folder folder)
                 throws javax.mail.MessagingException

Specified by:
renameTo in class javax.mail.Folder
Throws:
javax.mail.MessagingException

open

public void open(int mode)
          throws javax.mail.MessagingException

Specified by:
open in class javax.mail.Folder
Throws:
javax.mail.MessagingException

close

public void close(boolean expunge)
           throws javax.mail.MessagingException

Specified by:
close in class javax.mail.Folder
Throws:
javax.mail.MessagingException

isOpen

public boolean isOpen()

Specified by:
isOpen in class javax.mail.Folder

getPermanentFlags

public javax.mail.Flags getPermanentFlags()

Specified by:
getPermanentFlags in class javax.mail.Folder

getMessageCount

public int getMessageCount()
                    throws javax.mail.MessagingException

Specified by:
getMessageCount in class javax.mail.Folder
Throws:
javax.mail.MessagingException

getDeletedMessageCount

public int getDeletedMessageCount()
                           throws javax.mail.MessagingException

Overrides:
getDeletedMessageCount in class javax.mail.Folder
Throws:
javax.mail.MessagingException

getMessage

public javax.mail.Message getMessage(int index)
                              throws javax.mail.MessagingException

Specified by:
getMessage in class javax.mail.Folder
Throws:
javax.mail.MessagingException

appendMessages

public void appendMessages(javax.mail.Message[] messages)
                    throws javax.mail.MessagingException
Appends the specified messages to this folder. NOTE: The specified message array is destroyed upon processing to alleviate memory concerns with large messages. You should ensure the messages specified in this array are referenced elsewhere if you want to retain them.

Specified by:
appendMessages in class javax.mail.Folder
Parameters:
messages - an array of messages to append to the folder
Throws:
javax.mail.MessagingException - where an unexpected error occurs appending messages to the folder

expunge

public javax.mail.Message[] expunge()
                             throws javax.mail.MessagingException

Specified by:
expunge in class javax.mail.Folder
Throws:
javax.mail.MessagingException

getMessageByUID

public javax.mail.Message getMessageByUID(long uid)
                                   throws javax.mail.MessagingException

Specified by:
getMessageByUID in interface javax.mail.UIDFolder
Throws:
javax.mail.MessagingException

getMessagesByUID

public javax.mail.Message[] getMessagesByUID(long start,
                                             long end)
                                      throws javax.mail.MessagingException

Specified by:
getMessagesByUID in interface javax.mail.UIDFolder
Throws:
javax.mail.MessagingException

getMessagesByUID

public javax.mail.Message[] getMessagesByUID(long[] uids)
                                      throws javax.mail.MessagingException

Specified by:
getMessagesByUID in interface javax.mail.UIDFolder
Throws:
javax.mail.MessagingException

getUID

public long getUID(javax.mail.Message message)
            throws javax.mail.MessagingException

Specified by:
getUID in interface javax.mail.UIDFolder
Throws:
javax.mail.MessagingException

getUIDValidity

public long getUIDValidity()
                    throws javax.mail.MessagingException

Specified by:
getUIDValidity in interface javax.mail.UIDFolder
Throws:
javax.mail.MessagingException


Copyright © 2004-2011 Micronode. All Rights Reserved.