org.opencrx.application.imap
Class IMAPFolderImpl

java.lang.Object
  extended by javax.mail.Folder
      extended by org.opencrx.application.imap.IMAPFolderImpl
All Implemented Interfaces:
javax.mail.UIDFolder

public class IMAPFolderImpl
extends javax.mail.Folder
implements javax.mail.UIDFolder


Nested Class Summary
 
Nested classes/interfaces inherited from interface javax.mail.UIDFolder
javax.mail.UIDFolder.FetchProfileItem
 
Field Summary
protected  ActivitiesHelper activitiesHelper
           
protected static boolean CASE_INSENSITIVE_ADDRESS_LOOKUP
           
protected  File folderDir
           
protected static String INDEX_FILE_NAME
           
static String MAILDIR_PROPERTY_NAME
           
protected  Map<Long,String> messageIds
           
protected  String name
           
protected static long SYNCHRONIZE_REFRESH_RATE
           
protected  long synchronizeNextAt
           
protected static String UNSPECIFIED_ADDRESS
           
 
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
IMAPFolderImpl(String name, String username, ActivitiesHelper activitiesHelper)
           
 
Method Summary
protected  void addMedia(javax.mail.internet.MimeMessage mimeMessage, Email emailActivity)
           
 void appendMessages(javax.mail.Message[] newMessages)
           
 void close(boolean arg0)
           
 boolean create(int arg0)
           
 boolean delete(boolean arg0)
           
 boolean exists()
           
 javax.mail.Message[] expunge()
           
 javax.mail.Folder getFolder(String arg0)
           
 String getFullName()
           
protected  String[] getInternetAddresses(javax.mail.Address[] addresses)
           
static File getMailDir(String username)
           
 javax.mail.Message getMessage(int messageNumber)
           
 javax.mail.Message getMessageByUID(long uid)
           
 int getMessageCount()
           
 javax.mail.Message[] getMessagesByUID(long[] uids)
           
 javax.mail.Message[] getMessagesByUID(long start, long end)
           
 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(String arg0)
           
 void open(int arg0)
           
protected  String[] parseContentType(String contentType)
           
 boolean renameTo(javax.mail.Folder arg0)
           
 
Methods inherited from class javax.mail.Folder
addConnectionListener, addFolderListener, addMessageChangedListener, addMessageCountListener, copyMessages, fetch, finalize, getDeletedMessageCount, 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
 

Field Detail

CASE_INSENSITIVE_ADDRESS_LOOKUP

protected static final boolean CASE_INSENSITIVE_ADDRESS_LOOKUP
See Also:
Constant Field Values

UNSPECIFIED_ADDRESS

protected static final String UNSPECIFIED_ADDRESS
See Also:
Constant Field Values

INDEX_FILE_NAME

protected static final String INDEX_FILE_NAME
See Also:
Constant Field Values

SYNCHRONIZE_REFRESH_RATE

protected static final long SYNCHRONIZE_REFRESH_RATE
See Also:
Constant Field Values

MAILDIR_PROPERTY_NAME

public static final String MAILDIR_PROPERTY_NAME
See Also:
Constant Field Values

name

protected final String name

activitiesHelper

protected final ActivitiesHelper activitiesHelper

messageIds

protected final Map<Long,String> messageIds

folderDir

protected File folderDir

synchronizeNextAt

protected long synchronizeNextAt
Constructor Detail

IMAPFolderImpl

public IMAPFolderImpl(String name,
                      String username,
                      ActivitiesHelper activitiesHelper)
Method Detail

getMailDir

public static File getMailDir(String username)

getInternetAddresses

protected String[] getInternetAddresses(javax.mail.Address[] addresses)
                                 throws javax.mail.internet.AddressException
Throws:
javax.mail.internet.AddressException

parseContentType

protected String[] parseContentType(String contentType)

addMedia

protected void addMedia(javax.mail.internet.MimeMessage mimeMessage,
                        Email emailActivity)
                 throws IOException,
                        javax.mail.MessagingException
Throws:
IOException
javax.mail.MessagingException

appendMessages

public void appendMessages(javax.mail.Message[] newMessages)
                    throws javax.mail.MessagingException
Specified by:
appendMessages in class javax.mail.Folder
Throws:
javax.mail.MessagingException

close

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

create

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

delete

public boolean delete(boolean arg0)
               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(String arg0)
                            throws javax.mail.MessagingException
Specified by:
getFolder in class javax.mail.Folder
Throws:
javax.mail.MessagingException

getMessage

public javax.mail.Message getMessage(int messageNumber)
                              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

getFullName

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

getName

public 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(String arg0)
                         throws javax.mail.MessagingException
Specified by:
list in class javax.mail.Folder
Throws:
javax.mail.MessagingException

open

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

renameTo

public boolean renameTo(javax.mail.Folder arg0)
                 throws javax.mail.MessagingException
Specified by:
renameTo 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[] uids)
                                      throws javax.mail.MessagingException
Specified by:
getMessagesByUID 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

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


This software is published under the BSD license. Copyright © 2003-2008, CRIXP AG, Switzerland, All rights reserved. Use is subject to license terms.