|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectadams.core.net.EmailHelper
public class EmailHelper
A helper class for emails.
| Field Summary | |
|---|---|
static String |
DEFAULT_ADDRESS_FROM
The default "from" email address. |
static String |
DEFAULT_SENDEMAIL
The default "send email". |
static String |
DEFAULT_SIGNATURE
The default "signature". |
static String |
ENABLED
Whether Email support is enabled. |
static String |
FILENAME
the name of the props file. |
protected static Properties |
m_Properties
the properties. |
static String |
SIGNATURE_SEPARATOR
the separator between body and signature. |
static String |
SMTP_PASSWORD
The password the SMTP server. |
static String |
SMTP_PORT
The SMTP port. |
static String |
SMTP_REQUIRES_AUTHENTICATION
Whether authentication is necessary. |
static String |
SMTP_SERVER
The SMTP server. |
static String |
SMTP_START_TLS
Whether STARTTLS is necessary. |
static String |
SMTP_TIMEOUT
The timeout for the SMTP server. |
static String |
SMTP_USER
The user for the SMTP server. |
| Constructor Summary | |
|---|---|
EmailHelper()
|
|
| Method Summary | |
|---|---|
static String[] |
breakUp(String s,
int columns)
Breaks up the string into lines, using the specified hard line limit. |
static String |
combine(String body,
String signature)
Combines body and signature, but only if the signatures is neither null nor empty. |
static String |
createBoundary()
Creates a random boundary string. |
static String |
getDefaultFromAddress()
Returns the default FROM address. |
static AbstractSendEmail |
getDefaultSendEmail()
Returns the default send email class. |
static String |
getDefaultSignature()
Returns the default signature. |
static org.apache.tika.mime.MediaType |
getMimeType(File file)
Tries to determine the MIME type of a file by checking its magic bytes. |
static org.apache.tika.mime.MediaType |
getMimeType(String filename)
Tries to determine the MIME type of a file by checking its magic bytes. |
static Properties |
getProperties()
Returns the underlying properties. |
static BasePassword |
getSmtpPassword()
Returns the SMTP password. |
static int |
getSmtpPort()
Returns the SMTP port. |
static boolean |
getSmtpRequiresAuthentication()
Returns whether the server requires authentication. |
static String |
getSmtpServer()
Returns the SMTP server. |
static boolean |
getSmtpStartTLS()
Returns whether to start TLS. |
static int |
getSmtpTimeout()
Returns the timeout (in msecs) for the server. |
static String |
getSmtpUser()
Returns the SMTP user. |
static boolean |
isEnabled()
Returns whether email support has been enabled. |
static boolean |
writeProperties()
Writes the specified properties to disk. |
static boolean |
writeProperties(Properties props)
Writes the specified properties to disk. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String FILENAME
public static final String ENABLED
public static final String SMTP_SERVER
public static final String SMTP_PORT
public static final String SMTP_REQUIRES_AUTHENTICATION
public static final String SMTP_START_TLS
public static final String SMTP_USER
public static final String SMTP_PASSWORD
public static final String SMTP_TIMEOUT
public static final String DEFAULT_ADDRESS_FROM
public static final String DEFAULT_SIGNATURE
public static final String DEFAULT_SENDEMAIL
public static final String SIGNATURE_SEPARATOR
protected static Properties m_Properties
| Constructor Detail |
|---|
public EmailHelper()
| Method Detail |
|---|
public static Properties getProperties()
public static boolean writeProperties()
props - the properties to write to disk
public static boolean writeProperties(Properties props)
props - the properties to write to disk
public static boolean isEnabled()
public static String getSmtpServer()
public static int getSmtpPort()
public static boolean getSmtpStartTLS()
public static boolean getSmtpRequiresAuthentication()
public static int getSmtpTimeout()
public static String getSmtpUser()
public static BasePassword getSmtpPassword()
public static String getDefaultFromAddress()
public static String getDefaultSignature()
Utils.backQuoteChars(String)public static AbstractSendEmail getDefaultSendEmail()
public static String combine(String body,
String signature)
body - the actual body of the emailsignature - the signature to add, ignored if null or empty
public static org.apache.tika.mime.MediaType getMimeType(File file)
file - the file to check
MediaType.OCTET_STREAM if it failspublic static org.apache.tika.mime.MediaType getMimeType(String filename)
filename - the file to check
MediaType.OCTET_STREAM if it failspublic static String createBoundary()
public static String[] breakUp(String s,
int columns)
s - the string to break upcolumns - the hard line limt
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||