public class AlfrescoImapFolder extends AbstractImapFolder implements Serializable
AbstractImapFolder.CommandCallback<T>
logger, MAX_RETRIES, serviceRegistry
Constructor and Description |
---|
AlfrescoImapFolder(FileInfo folderInfo,
String userName,
String folderName,
String folderPath,
AlfrescoImapConst.ImapViewMode viewMode,
boolean extractAttachmentsEnabled,
ImapService imapService,
ServiceRegistry serviceRegistry,
int mountPointId)
Constructs
AlfrescoImapFolder object. |
AlfrescoImapFolder(FileInfo folderInfo,
String userName,
String folderName,
String folderPath,
AlfrescoImapConst.ImapViewMode viewMode,
ImapService imapService,
ServiceRegistry serviceRegistry,
Boolean selectable,
boolean extractAttachmentsEnabled,
int mountPointId)
Constructs
AlfrescoImapFolder object. |
Modifier and Type | Method and Description |
---|---|
protected long |
appendMessageInternal(MimeMessage message,
Flags flags,
Date internalDate)
Appends message to the folder.
|
protected long |
copyMessageInternal(long uid,
com.icegreen.greenmail.store.MailFolder toFolder)
Copies message with the given UID to the specified
MailFolder . |
void |
deleteAllMessagesInternal()
Marks all messages in the folder as deleted using
Flags.Flag.DELETED flag. |
protected void |
expungeInternal()
Deletes messages marked with
Flags.Flag.DELETED . |
protected void |
expungeInternal(long uid)
Deletes messages marked with
Flags.Flag.DELETED . |
int |
getFirstUnseen()
Returns the MSN number of the first unseen message.
|
FileInfo |
getFolderInfo() |
String |
getFolderPath() |
protected ImapService.FolderStatus |
getFolderStatus() |
String |
getFullName() |
int |
getMessageCount()
Returns count of the messages in the folder.
|
protected com.icegreen.greenmail.store.SimpleStoredMessage |
getMessageInternal(long uid)
Returns message by its UID.
|
protected List<com.icegreen.greenmail.store.SimpleStoredMessage> |
getMessagesInternal()
Returns list of all messages in the folder.
|
protected List<com.icegreen.greenmail.store.SimpleStoredMessage> |
getMessagesInternal(com.icegreen.greenmail.foedus.util.MsgRangeFilter msgRangeFilter)
Returns list of messages by filter.
|
long[] |
getMessageUids()
Returns UIDs of all messages in the folder.
|
int |
getMsn(long uid)
Returns message sequence number in the folder by its UID.
|
String |
getName() |
protected List<com.icegreen.greenmail.store.SimpleStoredMessage> |
getNonDeletedMessagesInternal()
Returns the list of messages that have no
Flags.Flag.DELETED flag set for current user. |
Flags |
getPermanentFlags()
Returns permanent flags.
|
int |
getRecentCount(boolean reset)
Returns count of messages with
Flags.Flag.RECENT flag. |
long |
getUidNext()
Returns UIDNEXT value of the folder.
|
long |
getUidValidity()
Returns UIDVALIDITY value of the folder.
|
int |
getUnseenCount()
Returns count of the messages with
Flags.Flag.SEEN in the folder for the current user. |
AlfrescoImapConst.ImapViewMode |
getViewMode() |
boolean |
isExtractAttachmentsEnabled() |
boolean |
isMarked() |
protected boolean |
isReadOnly()
Whether the folder is read-only for user.
|
boolean |
isSelectable() |
protected void |
replaceFlagsInternal(Flags flags,
long uid,
com.icegreen.greenmail.store.FolderListener silentListener,
boolean addUid)
Replaces flags for the message with the given UID.
|
boolean |
reset()
Invalidates the current cached state
|
protected long[] |
searchInternal(SearchTerm searchTerm) |
protected void |
setFlagsInternal(Flags flags,
boolean value,
long uid,
com.icegreen.greenmail.store.FolderListener silentListener,
boolean addUid)
Sets flags for the message with the given UID.
|
addListener, appendMessage, checkParameter, copyMessage, deleteAllMessages, expunge, expunge, getMessage, getMessages, getMessages, getNonDeletedMessages, notifyFlagUpdate, removeListener, replaceFlags, search, setFlags, signalDeletion, store, store
public AlfrescoImapFolder(FileInfo folderInfo, String userName, String folderName, String folderPath, AlfrescoImapConst.ImapViewMode viewMode, boolean extractAttachmentsEnabled, ImapService imapService, ServiceRegistry serviceRegistry, int mountPointId)
AlfrescoImapFolder
object.folderInfo
- - reference to the FileInfo
object representing the folder.userName
- - name of user (e.g. "admin" for admin user).folderName
- - name of the folder.folderPath
- - path of the folder.viewMode
- - defines view mode. Can be one of the following: AlfrescoImapConst.ImapViewMode.ARCHIVE
or AlfrescoImapConst.ImapViewMode.VIRTUAL
.extractAttachmentsEnabled
- booleanimapService
- ImapServiceserviceRegistry
- ServiceRegistrymountPointId
- - id of the mount point.public AlfrescoImapFolder(FileInfo folderInfo, String userName, String folderName, String folderPath, AlfrescoImapConst.ImapViewMode viewMode, ImapService imapService, ServiceRegistry serviceRegistry, Boolean selectable, boolean extractAttachmentsEnabled, int mountPointId)
AlfrescoImapFolder
object.folderInfo
- - reference to the FileInfo
object representing the folder.userName
- - name of the user (e.g. "admin" for admin user).folderName
- - name of the folder.folderPath
- - path of the folder.viewMode
- - defines view mode. Can be one of the following: AlfrescoImapConst.ImapViewMode.ARCHIVE
or AlfrescoImapConst.ImapViewMode.VIRTUAL
.imapService
- - the IMAP service.serviceRegistry
- ServiceRegistryselectable
- - defines whether the folder is selectable or not.extractAttachmentsEnabled
- booleanmountPointId
- intpublic boolean isExtractAttachmentsEnabled()
public String getFullName()
getFullName
in interface com.icegreen.greenmail.store.MailFolder
public String getName()
getName
in interface com.icegreen.greenmail.store.MailFolder
public boolean isSelectable()
isSelectable
in interface com.icegreen.greenmail.store.MailFolder
public boolean reset()
true
if this instance is still valid for reuseprotected ImapService.FolderStatus getFolderStatus()
protected long appendMessageInternal(MimeMessage message, Flags flags, Date internalDate) throws FileExistsException, FileNotFoundException, IOException, MessagingException
appendMessageInternal
in class AbstractImapFolder
message
- - message.flags
- - message flags.internalDate
- - not used. Current date used instead.FileExistsException
FileNotFoundException
IOException
MessagingException
protected long copyMessageInternal(long uid, com.icegreen.greenmail.store.MailFolder toFolder) throws MessagingException, FileExistsException, FileNotFoundException, IOException
MailFolder
.copyMessageInternal
in class AbstractImapFolder
uid
- - UID of the messagetoFolder
- - reference to the destination folder.MessagingException
IOException
FileNotFoundException
FileExistsException
public void deleteAllMessagesInternal() throws com.icegreen.greenmail.store.FolderException
Flags.Flag.DELETED
flag.deleteAllMessagesInternal
in class AbstractImapFolder
com.icegreen.greenmail.store.FolderException
protected void expungeInternal() throws com.icegreen.greenmail.store.FolderException
Flags.Flag.DELETED
. Note that this message deletes all messages with this flag.expungeInternal
in class AbstractImapFolder
com.icegreen.greenmail.store.FolderException
protected void expungeInternal(long uid) throws Exception
Flags.Flag.DELETED
. Note that this message deletes the message with current uidexpungeInternal
in class AbstractImapFolder
Exception
public int getFirstUnseen()
getFirstUnseen
in interface com.icegreen.greenmail.store.MailFolder
protected com.icegreen.greenmail.store.SimpleStoredMessage getMessageInternal(long uid) throws MessagingException
getMessageInternal
in class AbstractImapFolder
uid
- - UID of the message.MessagingException
public int getMessageCount()
getMessageCount
in interface com.icegreen.greenmail.store.MailFolder
public long[] getMessageUids()
getMessageUids
in interface com.icegreen.greenmail.store.MailFolder
protected List<com.icegreen.greenmail.store.SimpleStoredMessage> getMessagesInternal()
getMessagesInternal
in class AbstractImapFolder
SimpleStoredMessage
objects.protected List<com.icegreen.greenmail.store.SimpleStoredMessage> getMessagesInternal(com.icegreen.greenmail.foedus.util.MsgRangeFilter msgRangeFilter)
getMessagesInternal
in class AbstractImapFolder
msgRangeFilter
- - MsgRangeFilter
object representing filter.public int getMsn(long uid) throws com.icegreen.greenmail.store.FolderException
getMsn
in interface com.icegreen.greenmail.store.MailFolder
uid
- - message UID.com.icegreen.greenmail.store.FolderException
- if no message with given UID.protected List<com.icegreen.greenmail.store.SimpleStoredMessage> getNonDeletedMessagesInternal()
Flags.Flag.DELETED
flag set for current user.getNonDeletedMessagesInternal
in class AbstractImapFolder
public Flags getPermanentFlags()
getPermanentFlags
in interface com.icegreen.greenmail.store.MailFolder
Flags
object containing flags.public int getRecentCount(boolean reset)
Flags.Flag.RECENT
flag.
If reset
parameter is true
- removes Flags.Flag.RECENT
flag from
the message for current user.getRecentCount
in interface com.icegreen.greenmail.store.MailFolder
reset
- - if true the Flags.Flag.RECENT
will be deleted for current user if exists.public long getUidNext()
getUidNext
in interface com.icegreen.greenmail.store.MailFolder
public long getUidValidity()
getUidValidity
in interface com.icegreen.greenmail.store.MailFolder
public int getUnseenCount()
Flags.Flag.SEEN
in the folder for the current user.getUnseenCount
in interface com.icegreen.greenmail.store.MailFolder
protected void replaceFlagsInternal(Flags flags, long uid, com.icegreen.greenmail.store.FolderListener silentListener, boolean addUid) throws com.icegreen.greenmail.store.FolderException, MessagingException
addUid
is set to true
FolderListener
objects defined for this folder will be notified.
silentListener
can be provided - this listener wouldn't be notified.replaceFlagsInternal
in class AbstractImapFolder
flags
- - new flags.uid
- - message UID.silentListener
- - listener that shouldn't be notified.addUid
- - defines whether or not listeners be notified.com.icegreen.greenmail.store.FolderException
MessagingException
protected long[] searchInternal(SearchTerm searchTerm)
searchInternal
in class AbstractImapFolder
protected void setFlagsInternal(Flags flags, boolean value, long uid, com.icegreen.greenmail.store.FolderListener silentListener, boolean addUid) throws MessagingException, com.icegreen.greenmail.store.FolderException
addUid
is set to true
FolderListener
objects defined for this folder will be notified.
silentListener
can be provided - this listener wouldn't be notified.setFlagsInternal
in class AbstractImapFolder
flags
- - new flags.value
- - flags value.uid
- - message UID.silentListener
- - listener that shouldn't be notified.addUid
- - defines whether or not listeners be notified.MessagingException
com.icegreen.greenmail.store.FolderException
public String getFolderPath()
public FileInfo getFolderInfo()
public boolean isMarked()
isMarked
in interface com.icegreen.greenmail.store.MailFolder
protected boolean isReadOnly()
isReadOnly
in class AbstractImapFolder
boolean
public AlfrescoImapConst.ImapViewMode getViewMode()
Copyright © 2005–2017 Alfresco Software. All rights reserved.