Regain 2.1.0-STABLE API

net.sf.regain
Class ImapToolkit

java.lang.Object
  extended by 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/

Field Summary
private static java.util.regex.Pattern messagePattern
           
 
Constructor Summary
ImapToolkit()
           
 
Method Summary
static String cutMessageIdentifier(String url)
          Method removes the message identifier from an IMAP-url
static Map<String,Integer> getAllFolders(com.sun.mail.imap.IMAPFolder entryFolder, boolean recursive)
          Determines all subfolder from a start folder and the count of the messages in every folder.
static java.util.regex.Pattern getMessagePattern()
           
static boolean isMessageURL(String url)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

messagePattern

private static java.util.regex.Pattern messagePattern
Constructor Detail

ImapToolkit

public ImapToolkit()
Method Detail

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 from
recursive - 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 API

Regain 2.1.0-STABLE, Copyright (C) 2004-2010 Til Schneider, www.murfman.de, Thomas Tesche, www.clustersystems.info