Package org.cip4.jdflib.util.mime
Class MimeReader
- java.lang.Object
-
- org.cip4.jdflib.util.mime.MimeHelper
-
- org.cip4.jdflib.util.mime.MimeReader
-
public class MimeReader extends MimeHelper
-
-
Field Summary
-
Fields inherited from class org.cip4.jdflib.util.mime.MimeHelper
markSize, theMultipart
-
-
Constructor Summary
Constructors Constructor Description MimeReader()MimeReader(java.io.File file)create a root multipart from an input streamMimeReader(java.io.InputStream mimeStream)create a root multipart from an input streamMimeReader(java.lang.String url)create a root multipart from an input streamMimeReader(javax.mail.Multipart mp)create a reader from an existing mutipartMimeReader(MimeWriter writer)create a root multipart from a MimeWriter
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetFileName(java.lang.String url)JDFDocgetJDFDoc(java.io.InputStream stream, int index)get the JDF Doc from a stream, also handle non mime streams gracefullyjava.io.InputStreamgetURLInputStream(java.lang.String urlString)get the opened input stream for a given url stringXMLDocgetXMLDoc(java.io.InputStream stream, int index)get the JDF Doc from a stream, also handle non mime streams gracefully-
Methods inherited from class org.cip4.jdflib.util.mime.MimeHelper
getBodyPartHelper, getBodyParts, getCount, getCreatePartByCID, getCreatePartByLocalName, getMarkSize, getMultiPart, getPartByCID, getPartHelperByAttribute, getPartHelperByCID, getPartHelperByLocalName, setMarkSize
-
-
-
-
Constructor Detail
-
MimeReader
public MimeReader()
-
MimeReader
public MimeReader(javax.mail.Multipart mp)
create a reader from an existing mutipart- Parameters:
mp-
-
MimeReader
public MimeReader(java.io.InputStream mimeStream)
create a root multipart from an input stream- Parameters:
mimeStream- the input stream
-
MimeReader
public MimeReader(MimeWriter writer)
create a root multipart from a MimeWriter- Parameters:
writer- the input writer that will now be read
-
MimeReader
public MimeReader(java.lang.String url)
create a root multipart from an input stream- Parameters:
url- the url or file name
-
MimeReader
public MimeReader(java.io.File file)
create a root multipart from an input stream- Parameters:
url- the url or file name
-
-
Method Detail
-
getJDFDoc
public JDFDoc getJDFDoc(java.io.InputStream stream, int index)
get the JDF Doc from a stream, also handle non mime streams gracefully- Parameters:
stream- the stream to search inindex- the index of the body part to search- Returns:
- JDFDoc the parsed xml JDFDoc, null if stream does not contain xml
-
getXMLDoc
public XMLDoc getXMLDoc(java.io.InputStream stream, int index)
get the JDF Doc from a stream, also handle non mime streams gracefully- Parameters:
stream- the stream to search inindex- the index of the body part to search- Returns:
- JDFDoc the parsed xml JDFDoc, null if stream does not contain xml
-
getURLInputStream
public java.io.InputStream getURLInputStream(java.lang.String urlString)
get the opened input stream for a given url string- Parameters:
urlString-- Returns:
-
getFileName
public java.lang.String getFileName(java.lang.String url)
- Parameters:
url-- Returns:
-
-