public class MaildirStore extends Object implements org.apache.james.mailbox.store.mail.UidProvider<Integer>, org.apache.james.mailbox.store.mail.ModSeqProvider<Integer>
| Modifier and Type | Field and Description |
|---|---|
static String |
maildirDelimiter |
static String |
PATH_DOMAIN |
static String |
PATH_FULLUSER |
static String |
PATH_USER |
static String |
WILDCARD |
| Constructor and Description |
|---|
MaildirStore(String maildirLocation) |
MaildirStore(String maildirLocation,
org.apache.james.mailbox.MailboxPathLocker locker)
Construct a MaildirStore with a location.
|
| Modifier and Type | Method and Description |
|---|---|
MaildirFolder |
createMaildirFolder(org.apache.james.mailbox.store.mail.model.Mailbox<Integer> mailbox)
Create a
MaildirFolder for a mailbox |
String |
getFolderName(org.apache.james.mailbox.store.mail.model.Mailbox<Integer> mailbox)
Get the absolute name of the folder for a specific mailbox
|
String |
getFolderName(org.apache.james.mailbox.model.MailboxPath mailboxPath)
Get the absolute name of the folder for a specific mailbox
|
String |
getFolderName(String namespace,
String user,
String name)
Get the absolute name of the folder for a specific mailbox
|
String |
getMailboxNameFromFolderName(String folderName)
Transforms a folder name into a mailbox name
|
File |
getMailboxRootForUser(String user)
The main maildir folder containing all mailboxes for one user
|
String |
getMaildirLocation() |
File |
getMaildirRoot()
Return a File which is the root of all Maidirs.
|
long |
highestModSeq(org.apache.james.mailbox.MailboxSession session,
org.apache.james.mailbox.store.mail.model.Mailbox<Integer> mailbox) |
boolean |
isMessageNameStrictParse()
Returns whether the names of message files in this store are parsed in
a strict manner (
true), which means a size field and flags are
expected. |
long |
lastUid(org.apache.james.mailbox.MailboxSession session,
org.apache.james.mailbox.store.mail.model.Mailbox<Integer> mailbox) |
org.apache.james.mailbox.store.mail.model.Mailbox<Integer> |
loadMailbox(org.apache.james.mailbox.MailboxSession session,
File root,
String namespace,
String user,
String folderName)
Creates a Mailbox object with data loaded from the file system
|
org.apache.james.mailbox.store.mail.model.Mailbox<Integer> |
loadMailbox(org.apache.james.mailbox.MailboxSession session,
org.apache.james.mailbox.model.MailboxPath mailboxPath)
Creates a Mailbox object with data loaded from the file system
|
long |
nextModSeq(org.apache.james.mailbox.MailboxSession session,
org.apache.james.mailbox.store.mail.model.Mailbox<Integer> mailbox) |
long |
nextUid(org.apache.james.mailbox.MailboxSession session,
org.apache.james.mailbox.store.mail.model.Mailbox<Integer> mailbox) |
void |
setMessageNameStrictParse(boolean messageNameStrictParse)
Specifies whether the names of message files in this store are parsed in
a strict manner (
true), which means a size field and flags are
expected. |
String |
userRoot(String user)
Inserts the user name parts in the general maildir location String
|
public static final String PATH_USER
public static final String PATH_DOMAIN
public static final String PATH_FULLUSER
public static final String WILDCARD
public static final String maildirDelimiter
public MaildirStore(String maildirLocation, org.apache.james.mailbox.MailboxPathLocker locker)
maildirLocation - A String with variableslocker - public MaildirStore(String maildirLocation)
public String getMaildirLocation()
public MaildirFolder createMaildirFolder(org.apache.james.mailbox.store.mail.model.Mailbox<Integer> mailbox)
MaildirFolder for a mailboxmailbox - public org.apache.james.mailbox.store.mail.model.Mailbox<Integer> loadMailbox(org.apache.james.mailbox.MailboxSession session, File root, String namespace, String user, String folderName) throws org.apache.james.mailbox.exception.MailboxException
root - The main maildir folder containing the mailbox to loadnamespace - The namespace to useuser - The owner of this mailboxfolderName - The name of the mailbox folderorg.apache.james.mailbox.exception.MailboxException - If the mailbox folder doesn't exist or can't be readpublic org.apache.james.mailbox.store.mail.model.Mailbox<Integer> loadMailbox(org.apache.james.mailbox.MailboxSession session, org.apache.james.mailbox.model.MailboxPath mailboxPath) throws org.apache.james.mailbox.exception.MailboxNotFoundException, org.apache.james.mailbox.exception.MailboxException
mailboxPath - The path of the mailboxorg.apache.james.mailbox.exception.MailboxNotFoundException - If the mailbox folder doesn't existorg.apache.james.mailbox.exception.MailboxException - If the mailbox folder can't be readpublic String userRoot(String user)
user - The user to get the root for.public File getMailboxRootForUser(String user) throws org.apache.james.mailbox.exception.MailboxException
user - The user name of a mailboxorg.apache.james.mailbox.exception.MailboxException - If the folder does not exist or is no directorypublic File getMaildirRoot()
public String getMailboxNameFromFolderName(String folderName)
folderName - The name of the mailbox folderpublic String getFolderName(String namespace, String user, String name)
namespace - The namespace of the mailboxuser - The user of the mailboxname - The name of the mailboxpublic String getFolderName(org.apache.james.mailbox.store.mail.model.Mailbox<Integer> mailbox)
mailbox - The mailboxpublic String getFolderName(org.apache.james.mailbox.model.MailboxPath mailboxPath)
mailboxPath - The MailboxPathpublic long nextUid(org.apache.james.mailbox.MailboxSession session, org.apache.james.mailbox.store.mail.model.Mailbox<Integer> mailbox) throws org.apache.james.mailbox.exception.MailboxException
nextUid in interface org.apache.james.mailbox.store.mail.UidProvider<Integer>org.apache.james.mailbox.exception.MailboxExceptionUidProvider.nextUid(org.apache.james.mailbox.MailboxSession, org.apache.james.mailbox.store.mail.model.Mailbox)public long nextModSeq(org.apache.james.mailbox.MailboxSession session, org.apache.james.mailbox.store.mail.model.Mailbox<Integer> mailbox) throws org.apache.james.mailbox.exception.MailboxException
nextModSeq in interface org.apache.james.mailbox.store.mail.ModSeqProvider<Integer>org.apache.james.mailbox.exception.MailboxExceptionpublic long highestModSeq(org.apache.james.mailbox.MailboxSession session, org.apache.james.mailbox.store.mail.model.Mailbox<Integer> mailbox) throws org.apache.james.mailbox.exception.MailboxException
highestModSeq in interface org.apache.james.mailbox.store.mail.ModSeqProvider<Integer>org.apache.james.mailbox.exception.MailboxExceptionpublic long lastUid(org.apache.james.mailbox.MailboxSession session, org.apache.james.mailbox.store.mail.model.Mailbox<Integer> mailbox) throws org.apache.james.mailbox.exception.MailboxException
lastUid in interface org.apache.james.mailbox.store.mail.UidProvider<Integer>org.apache.james.mailbox.exception.MailboxExceptionpublic boolean isMessageNameStrictParse()
true), which means a size field and flags are
expected.public void setMessageNameStrictParse(boolean messageNameStrictParse)
true), which means a size field and flags are
expected.
Default is false.messageNameStrictParse - Copyright © 2010-2013 The Apache Software Foundation. All Rights Reserved.