|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.mailet.base.MailetUtil
public class MailetUtil
Collects utility methods.
Constructor Summary | |
---|---|
MailetUtil()
|
Method Summary | |
---|---|
static boolean |
getInitParameter(MailetConfig config,
String name,
boolean defaultValue)
Gets a boolean valued init parameter. |
static String |
normalizeSubject(String subj,
String prefix)
This takes the subject string and reduces (normailzes) it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MailetUtil()
Method Detail |
---|
public static String normalizeSubject(String subj, String prefix)
This takes the subject string and reduces (normailzes) it. Multiple "Re:" entries are reduced to one, and capitalized. The prefix is always moved/placed at the beginning of the line, and extra blanks are reduced, so that the output is always of the form:
<prefix> + <one-optional-"Re:"*gt; + <remaining subject>
I have done extensive testing of this routine with a standalone driver, and am leaving the commented out debug messages so that when someone decides to enhance this method, it can be yanked it from this file, embedded it with a test driver, and the comments enabled.
public static boolean getInitParameter(MailetConfig config, String name, boolean defaultValue)
Gets a boolean valued init parameter.
config
- not nullname
- name of the init parameter to be querieddefaultValue
- this value will be substituted when the named value
cannot be parse or when the init parameter is absent
true
(ignoring case);
false when the init parameter is false
(ignoring case);
otherwise the default value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |