|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object iaik.smime.DefaultCanonicalizer
public class DefaultCanonicalizer
The default canonicalizer.
This class implements the Canonicalizer
interface for ensuring that <CR> and <LF> always occurs together as
<CR><LF> except when binary content transfer encoding is used.
An application having or wishing to use a more specific canonicalization
scheme may implement the Canonicalizer
interface and register its new Canonicalizer by calling the static setCanonicalizer
method of the SMimeParameters
class.
Note that for outging messages the Canonicalizer only is visited when
modelling body parts and multiparts by classes SMimeBodyPart
and SMimeMultipart
classes or when supplying
a text message by means of method setText
for a
multipart/signed SignedContent
object. When parsing an ingoing message the canonicalizer only is
utilized for the contents part of a multipart/signed message.
This class implements the canonicalizeOutputStream
method by only returning a CanonicalizeOutputStream doing
the canonicalization for non-binary entities and the canonicalizeInputStream
method by returning a CanonicalizeInputStream:
public OutputStream canonicalizeOutputStream(OutputStream os, String contentType, String contentTransferEncoding) { if ((contentTransferEncoding == null) || (contentTransferEncoding.indexOf("binary") == -1)) { return new CanonicalizeOutputStream(os); } else { //do not canonicalize binary data return os; } } public InputStream canonicalizeInputStream(LineInputStream is, String boundary) { return new CanonicalizeInputStream(is, boundary); }
Canonicalizer
Constructor Summary | |
---|---|
DefaultCanonicalizer()
Empty default constructor. |
Method Summary | |
---|---|
java.io.InputStream |
canonicalizeInputStream(LineInputStream is,
java.lang.String boundary)
Wraps an canonicalizing input stream around the given input stream |
java.io.OutputStream |
canonicalizeOutputStream(java.io.OutputStream os,
java.lang.String contentType,
java.lang.String contentTransferEncoding)
Wraps an canonicalizing output stream around the given output stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultCanonicalizer()
Method Detail |
---|
public java.io.OutputStream canonicalizeOutputStream(java.io.OutputStream os, java.lang.String contentType, java.lang.String contentTransferEncoding)
canonicalizeOutputStream
in interface Canonicalizer
os
- the (buffered) output stream where the MIME body part shall be written.contentType
- the MIME content type of the body part to be writtencontentTransferEncoding
- the content transfer encoding of the body part
to be written.
java.io.IOException
- if an error has to be thrown when setting the
canonicalizing wrapping streampublic java.io.InputStream canonicalizeInputStream(LineInputStream is, java.lang.String boundary)
canonicalizeInputStream
in interface Canonicalizer
is
- the input stream representing the MIME entity to be canonicalizedboundary
- the boundary line indicating the end of the MIME entity
java.io.IOException
- if an error has to be thrown when setting the
canonicalizing wrapping stream
|
This Javadoc may contain text parts from text parts from IETF Internet Standard specifications (see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |