Package org.cip4.jdflib.util.mime
Class MimeHelper
- java.lang.Object
-
- org.cip4.jdflib.util.mime.MimeHelper
-
- Direct Known Subclasses:
MimeReader,MimeWriter
public class MimeHelper extends java.lang.Objectclass to create and write mime files
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.apache.commons.logging.Loglogprotected intmarkSizeprotected javax.mail.MultiparttheMultipart
-
Constructor Summary
Constructors Constructor Description MimeHelper()MimeHelper(javax.mail.Multipart mp)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BodyPartHelpergetBodyPartHelper(int i)javax.mail.BodyPart[]getBodyParts()get all the parts of of a multipart anintgetCount()javax.mail.BodyPartgetCreatePartByCID(java.lang.String cid)get the MIME BodyPart from a multiPart package with a given cid create one if it does not exist;BodyPartHelpergetCreatePartByLocalName(java.lang.String name)get the MIME BodyPart from a multiPart package with a given cid create one if it does not exist;intgetMarkSize()javax.mail.MultipartgetMultiPart()javax.mail.BodyPartgetPartByCID(java.lang.String cid)get the MIME BodyPart from a multiPart package with a given cidBodyPartHelpergetPartHelperByAttribute(java.lang.String key, java.lang.String value)get the MIME BodyPart from a multiPart package with a given headerBodyPartHelpergetPartHelperByCID(java.lang.String cid)get the MIME BodyPart from a multiPart package with a given cidBodyPartHelpergetPartHelperByLocalName(java.lang.String name)voidsetMarkSize(int markSize)the maximum stream mark for resetting
-
-
-
Method Detail
-
getCount
public int getCount()
- Returns:
-
getMultiPart
public javax.mail.Multipart getMultiPart()
- Returns:
-
getCreatePartByCID
public javax.mail.BodyPart getCreatePartByCID(java.lang.String cid)
get the MIME BodyPart from a multiPart package with a given cid create one if it does not exist;- Parameters:
cid- the cid of the requested bodypart- Returns:
- BodyPart the matching BodyPart, null if none is found
-
getCreatePartByLocalName
public BodyPartHelper getCreatePartByLocalName(java.lang.String name)
get the MIME BodyPart from a multiPart package with a given cid create one if it does not exist;- Parameters:
name- the cid of the requested bodypart- Returns:
- BodyPart the matching BodyPart, null if none is found
-
getPartByCID
public javax.mail.BodyPart getPartByCID(java.lang.String cid)
get the MIME BodyPart from a multiPart package with a given cid- Parameters:
cid- the cid of the requested bodypart- Returns:
- BodyPart the matching BodyPart, null if none is found
-
getPartHelperByCID
public BodyPartHelper getPartHelperByCID(java.lang.String cid)
get the MIME BodyPart from a multiPart package with a given cid- Parameters:
cid- the cid of the requested bodypart- Returns:
- BodyPartHelper the matching BodyPart, null if none is found
-
getPartHelperByAttribute
public BodyPartHelper getPartHelperByAttribute(java.lang.String key, java.lang.String value)
get the MIME BodyPart from a multiPart package with a given header- Returns:
- BodyPartHelper the matching BodyPart, null if none is found
-
getBodyPartHelper
public BodyPartHelper getBodyPartHelper(int i)
- Parameters:
i-- Returns:
-
getBodyParts
public javax.mail.BodyPart[] getBodyParts()
get all the parts of of a multipart an- Returns:
- the array of parts, null if snafu...
-
getMarkSize
public int getMarkSize()
- Returns:
- the markSize, i.e. the maximum stream mark for resetting
-
setMarkSize
public void setMarkSize(int markSize)
the maximum stream mark for resetting- Parameters:
markSize- the markSize to set
-
getPartHelperByLocalName
public BodyPartHelper getPartHelperByLocalName(java.lang.String name)
-
-