net.sf.regain
Class ImapToolkit
java.lang.Object
net.sf.regain.ImapToolkit
public class ImapToolkit
- extends Object
Toolkit for handling IMAP specific functions. We label the messages/attachments with the following
pattern:
imap-URL/foldername/message_uid_(attachment_id) (attachment is optional)
Remark: The above URL is not a valid URL and has to be handled a specialised way
- Author:
- Thomas Tesche (thtesche), http://www.thtesche.com/
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
messagePattern
private static java.util.regex.Pattern messagePattern
ImapToolkit
public ImapToolkit()
getMessagePattern
public static java.util.regex.Pattern getMessagePattern()
isMessageURL
public static boolean isMessageURL(String url)
throws Exception
- Throws:
Exception
cutMessageIdentifier
public static String cutMessageIdentifier(String url)
throws Exception
- Method removes the message identifier from an IMAP-url
- Parameters:
url
- the URL with message identifier (e.g. host:port/path/message_UID
- Returns:
- the 'real' IMAP URL (e.g. host:port/path/
- Throws:
Exception
getAllFolders
public static Map<String,Integer> getAllFolders(com.sun.mail.imap.IMAPFolder entryFolder,
boolean recursive)
throws Exception
- Determines all subfolder from a start folder and the count of the messages in every folder.
- Parameters:
entryFolder
- the basis folder to start fromrecursive
- true
if the folders and messages count should
be obtained recursivly
- Returns:
- Map of folder name and message count for this folder
- Throws:
Exception
Regain 2.1.0-STABLE, Copyright (C) 2004-2010 Til Schneider, www.murfman.de, Thomas Tesche, www.clustersystems.info