|
Enhydra-Oyster 2.1-7 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.enhydra.oyster.mail.ContentAnalyzer
Analyzes content which will be placed in MimeBodyPart and suggests which
Content-Transfer-Encoding header parameter should be used (7bit,
quoted-printable or base64). ContentAnalyzer makes the following checks, and
according to them decisions about which Content-Transfer-Encoding to suggest:
7bit: if all checked characters (or bytes) are in group of ASCII characters
which are less than 127 (7F hexadecimal) and higher than 31 (1F hexadecimal).
Characters: HT (Horizontal Tab) 9 (09 hexadecimal), and combinaton of CR
(Carriage Return) 13 (0D hexadecimal) and LF (Line Feed) 11 (0A hexadecimal)
are also allowed. Single usage of CR or LF characters or it's combination
LFCR are not permitted for this type Content-Transfer-Encoding. Also, acording
to RFC822, no line should be longer than 1000 characters with included trailing
CRLF charachters.
quoted-printable: if at least one character does not satisfy previous condition,
and if number of those characters do not exceed 30 percent of all characters.
base64: if number of those characters which do not satisfy 7bit condition
exceed 30 percent of all characters.
Constructor Summary | |
ContentAnalyzer()
Simple constructor. |
Method Summary | |
void |
analyse()
Performs analyze of content data and accoding to that decides which Content-Transfer-Encoding to suggesst. |
java.lang.String |
getPreferedEncoding()
Returns suggested encoding, after finished analyze. |
void |
isCharFor7BitEncoding(int dataToCheck)
Method checks one charachter passed as integer, if it passes condition for implementation of 7bit Content-Transfer-Encoding. |
void |
isFor7BitEncoding(java.io.File fileToCheck)
Method checks data passed from File which will be used later in the process of creation of content in MimeBodyPart, if it passes condition for implementation of 7bit Content-Transfer-Encoding. |
void |
isFor7BitEncoding(java.io.InputStream dataToCheck)
Method checks data passed as InputStream which will be used later in the process of creation of content in MimeBodyPart, if it passes condition for implementation of 7bit Content-Transfer-Encoding. |
void |
reset()
Resets all storaged values in ContentAnalyzer object to default values and prepares object for new use. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ContentAnalyzer()
Method Detail |
public void isCharFor7BitEncoding(int dataToCheck)
dataToCheck
- integer represetation of passed byte for checkpublic void isFor7BitEncoding(java.io.InputStream dataToCheck) throws SMIMEException
dataToCheck
- content data which has to be checked represented as
InputStream
SMIMEException
- caused by non SMIMEException which is IOExceptionpublic void isFor7BitEncoding(java.io.File fileToCheck) throws SMIMEException
fileToCheck
- pointer to file which data has to be checked.
SMIMEException
- caused by non SMIMEException which is IOExceptionpublic void analyse()
public java.lang.String getPreferedEncoding()
public void reset()
|
Enhydra-Oyster 2.1-7 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |