com.openexchange.mail.mime
Class FullnameFolder

java.lang.Object
  extended by javax.mail.Folder
      extended by com.openexchange.mail.mime.FullnameFolder

public final class FullnameFolder
extends javax.mail.Folder

FullnameFolder - A Folder implementation whose only purpose is to provide fullname, separator character and UIDs.

All other methods will throw an UnsupportedOperationException.

Author:
Thorben Betten

Field Summary
 
Fields inherited from class javax.mail.Folder
HOLDS_FOLDERS, HOLDS_MESSAGES, READ_ONLY, READ_WRITE
 
Constructor Summary
FullnameFolder(java.lang.String fullname, char separator, java.lang.String uid)
          Initializes a new FullnameFolder
FullnameFolder(java.lang.String fullname, char separator, java.lang.String[] uids)
          Initializes a new FullnameFolder
 
Method Summary
 void appendMessages(javax.mail.Message[] msgs)
           
 void close(boolean expunge)
           
 boolean create(int type)
           
 boolean delete(boolean recurse)
           
 boolean exists()
           
 javax.mail.Message[] expunge()
           
 javax.mail.Folder getFolder(java.lang.String name)
           
 java.lang.String getFullName()
           
 javax.mail.Message getMessage(int msgnum)
           
 int getMessageCount()
           
 java.lang.String getName()
           
 javax.mail.Folder getParent()
           
 javax.mail.Flags getPermanentFlags()
           
 char getSeparator()
           
 int getType()
           
 java.lang.String getUID(javax.mail.Message message)
           
 boolean hasNewMessages()
           
 boolean isOpen()
           
 javax.mail.Folder[] list(java.lang.String pattern)
           
 void open(int mode)
           
 boolean renameTo(javax.mail.Folder f)
           
 
Methods inherited from class javax.mail.Folder
addConnectionListener, addFolderListener, addMessageChangedListener, addMessageCountListener, copyMessages, fetch, getDeletedMessageCount, getMessages, getMessages, getMessages, getMode, getNewMessageCount, getStore, getUnreadMessageCount, getURLName, isSubscribed, list, listSubscribed, listSubscribed, removeConnectionListener, removeFolderListener, removeMessageChangedListener, removeMessageCountListener, search, search, setFlags, setFlags, setFlags, setSubscribed, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FullnameFolder

public FullnameFolder(java.lang.String fullname,
                      char separator,
                      java.lang.String[] uids)
Initializes a new FullnameFolder

Parameters:
fullname - The folder's fullname
separator - The folder's separator character
uids - The UIDs corresponding to appropriate message numbers such that uids[0] is the UID of message numbered with 1 and so on.

FullnameFolder

public FullnameFolder(java.lang.String fullname,
                      char separator,
                      java.lang.String uid)
Initializes a new FullnameFolder

Parameters:
fullname - The folder's fullname
separator - The folder's separator character
uid - The UID corresponding to appropriate message.
Method Detail

appendMessages

public void appendMessages(javax.mail.Message[] msgs)
                    throws javax.mail.MessagingException
Specified by:
appendMessages 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

create

public boolean create(int type)
               throws javax.mail.MessagingException
Specified by:
create 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

exists

public boolean exists()
               throws javax.mail.MessagingException
Specified by:
exists in class javax.mail.Folder
Throws:
javax.mail.MessagingException

expunge

public javax.mail.Message[] expunge()
                             throws javax.mail.MessagingException
Specified by:
expunge 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

getFullName

public java.lang.String getFullName()
Specified by:
getFullName in class javax.mail.Folder

getMessage

public javax.mail.Message getMessage(int msgnum)
                              throws javax.mail.MessagingException
Specified by:
getMessage in class javax.mail.Folder
Throws:
javax.mail.MessagingException

getMessageCount

public int getMessageCount()
                    throws javax.mail.MessagingException
Specified by:
getMessageCount in class javax.mail.Folder
Throws:
javax.mail.MessagingException

getName

public java.lang.String getName()
Specified by:
getName 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

getPermanentFlags

public javax.mail.Flags getPermanentFlags()
Specified by:
getPermanentFlags in class javax.mail.Folder

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

hasNewMessages

public boolean hasNewMessages()
                       throws javax.mail.MessagingException
Specified by:
hasNewMessages in class javax.mail.Folder
Throws:
javax.mail.MessagingException

isOpen

public boolean isOpen()
Specified by:
isOpen in class javax.mail.Folder

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

open

public void open(int mode)
          throws javax.mail.MessagingException
Specified by:
open in class javax.mail.Folder
Throws:
javax.mail.MessagingException

renameTo

public boolean renameTo(javax.mail.Folder f)
                 throws javax.mail.MessagingException
Specified by:
renameTo in class javax.mail.Folder
Throws:
javax.mail.MessagingException

getUID

public java.lang.String getUID(javax.mail.Message message)