mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)
57024: Merged V4.2-BUG-FIX (4.2.1) to HEAD-BUG-FIX (Cloud/4.3) 56491: Merged HEAD-BUG-FIX to V4.2-BUG-FIX (4.2.1) 55495: <<NOT IN 4.1.6>> Merged V4.1-BUG-FIX (4.1.7) to HEAD-BUG-FIX (4.2) 55338: Merged DEV to V4.1-BUG-FIX 50363: MNT-644: imap subsystem lists all directories if an email is moved to Alfresco and decreases the performance of Email client Preventing caching on each AlfrescoImapHostManager.getFolder() method call git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@61657 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -228,20 +228,15 @@ public class AlfrescoImapHostManager implements ImapHostManager
|
||||
AlfrescoImapUser alfrescoUser = new AlfrescoImapUser(user.getEmail(), user.getLogin(), user.getPassword());
|
||||
String folderPath = getUnqualifiedMailboxPattern(
|
||||
alfrescoUser, mailboxName);
|
||||
// Warm up the cache if necessary
|
||||
|
||||
if (folderCache == null)
|
||||
{
|
||||
registerMailboxes(imapService.listMailboxes(alfrescoUser, "*", true));
|
||||
}
|
||||
// Try to retrieve from the cache
|
||||
AlfrescoImapFolder result = folderCache.get(folderPath);
|
||||
if (result != null && result.reset())
|
||||
{
|
||||
return result;
|
||||
registerMailBox(imapService.getOrCreateMailbox(alfrescoUser, mailboxName, true, false));
|
||||
}
|
||||
|
||||
// Look up and cache as a last resort
|
||||
return registerMailBox(imapService.getOrCreateMailbox(alfrescoUser, folderPath, true, false));
|
||||
AlfrescoImapFolder result = folderCache.get(folderPath);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -370,7 +365,12 @@ public class AlfrescoImapHostManager implements ImapHostManager
|
||||
private MailFolder registerMailBox(AlfrescoImapFolder mailbox)
|
||||
{
|
||||
String folderPath = mailbox.getFolderPath();
|
||||
if ((mailbox.isSelectable() || folderPath.isEmpty()) && folderCache != null)
|
||||
if (folderCache == null)
|
||||
{
|
||||
folderCache = new HashMap<String, AlfrescoImapFolder>(2);
|
||||
}
|
||||
|
||||
if ((mailbox.isSelectable() || folderPath.isEmpty()))
|
||||
{
|
||||
AlfrescoImapFolder oldFolder = folderCache.get(folderPath);
|
||||
if (oldFolder != null
|
||||
|
Reference in New Issue
Block a user