public class BodyPartHelper extends Object
Modifier and Type | Field and Description |
---|---|
protected javax.mail.BodyPart |
theBodyPart |
Constructor and Description |
---|
BodyPartHelper()
creates a new bodypart
|
BodyPartHelper(javax.mail.BodyPart bp) |
Modifier and Type | Method and Description |
---|---|
void |
createBodyPart() |
javax.mail.BodyPart |
createFromURL(String urlString) |
javax.mail.BodyPart |
getBodyPart() |
String |
getContentID()
get the ContentID header of a bodypart a string
|
String |
getFileName()
get the filename header of a bodypart a string if no file name is set, a unique filename is generated from cid and content type
|
int |
getIndex() |
InputStream |
getInputStream() |
JDFDoc |
getJDFDoc()
get the JDF Doc from a given body part
|
XMLDoc |
getXMLDoc()
get the JDF Doc from a given body part
|
boolean |
matchesCID(String cid)
check if a BodyPart matches a given cid
|
void |
setContent(XMLDoc xmlDoc)
sets the content of a bodypart to the xmlDoc - correctly handling non-ascii features and setting the correct content type
|
void |
setContentID(String cid) |
void |
setFileName(String path)
set the filename header of a bodypart to a string
|
void |
writeToDir(File directory) |
public BodyPartHelper(javax.mail.BodyPart bp)
bp
- public BodyPartHelper()
public javax.mail.BodyPart getBodyPart()
public void createBodyPart()
public void setContentID(String cid)
cid
- public void setFileName(String path)
path
- the path to setpublic String getFileName()
public boolean matchesCID(String cid)
cid
- the cid string any '<' '>' or 'cid:' prefixes are removed if null, anything matchespublic String getContentID()
public void setContent(XMLDoc xmlDoc) throws javax.mail.MessagingException, IOException
xmlDoc
- the xmlDoc to fill injavax.mail.MessagingException
IOException
public javax.mail.BodyPart createFromURL(String urlString)
urlString
- public JDFDoc getJDFDoc()
public XMLDoc getXMLDoc()
public void writeToDir(File directory) throws IOException, javax.mail.MessagingException
directory
- javax.mail.MessagingException
IOException
public int getIndex()
public InputStream getInputStream()
Copyright © 2018. All rights reserved.