Package org.bluezoo.gumdrop.mailbox.mbox
Class MboxMailboxFactory
java.lang.Object
org.bluezoo.gumdrop.mailbox.mbox.MboxMailboxFactory
- All Implemented Interfaces:
MailboxFactory
Factory for creating mbox-format mail store instances.
This factory creates mail stores that access mbox-format mailbox files. Both POP3 and IMAP use the store to access mailboxes.
The factory can be configured with a file extension for mbox files (default: ".mbox"). Only files with this extension are treated as mailboxes.
- Author:
- Chris Burdess
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new mbox mailbox factory.MboxMailboxFactory(File basedir) Creates a new mbox mailbox factory with default extension (.mbox).MboxMailboxFactory(Path basedir) Creates a new mbox mailbox factory with default extension (.mbox).MboxMailboxFactory(Path basedir, String extension) Creates a new mbox mailbox factory with custom extension. -
Method Summary
Modifier and TypeMethodDescriptionCreates a new mail store instance.Returns the base directory for all mailboxes.Returns the file extension used for mbox files.voidsetBaseDirectory(String baseDirectory) Sets the base directory for all mailboxes.voidsetBaseDirectory(Path baseDirectory) Sets the base directory for all mailboxes.voidsetExtension(String extension) Sets the file extension for mbox files.
-
Constructor Details
-
MboxMailboxFactory
public MboxMailboxFactory()Creates a new mbox mailbox factory. The base directory must be set viasetBaseDirectory(String)before use. -
MboxMailboxFactory
Creates a new mbox mailbox factory with default extension (.mbox).- Parameters:
basedir- the base directory containing all user mailboxes
-
MboxMailboxFactory
Creates a new mbox mailbox factory with default extension (.mbox).- Parameters:
basedir- the base directory containing all user mailboxes
-
MboxMailboxFactory
Creates a new mbox mailbox factory with custom extension.- Parameters:
basedir- the base directory containing all user mailboxesextension- the file extension for mbox files (e.g., ".mbox")
-
-
Method Details
-
setBaseDirectory
Sets the base directory for all mailboxes.- Parameters:
baseDirectory- the base directory path as a string
-
setBaseDirectory
Sets the base directory for all mailboxes.- Parameters:
baseDirectory- the base directory path
-
getBaseDirectory
Returns the base directory for all mailboxes.- Returns:
- the base directory path
-
setExtension
Sets the file extension for mbox files.- Parameters:
extension- the extension (e.g., ".mbox")
-
getExtension
Returns the file extension used for mbox files.- Returns:
- the extension (including leading dot)
-
createStore
Description copied from interface:MailboxFactoryCreates a new mail store instance. Each session should get its own store instance to ensure thread safety and proper session isolation.- Specified by:
createStorein interfaceMailboxFactory- Returns:
- a new mail store instance
-