Package org.cip4.jdflib.util.mime
Class MimeReader
java.lang.Object
org.cip4.jdflib.util.mime.MimeHelper
org.cip4.jdflib.util.mime.MimeReader
-
Field Summary
Fields inherited from class org.cip4.jdflib.util.mime.MimeHelper
markSize, theMultipart -
Constructor Summary
ConstructorsConstructorDescriptionMimeReader(jakarta.mail.Multipart mp) create a reader from an existing mutipartMimeReader(File file) create a root multipart from an input streamMimeReader(InputStream mimeStream) create a root multipart from an input streamMimeReader(String url) create a root multipart from an input streamMimeReader(MimeWriter writer) create a root multipart from a MimeWriter -
Method Summary
Modifier and TypeMethodDescriptiongetFileName(String url) getJDFDoc(InputStream stream, int index) get the JDF Doc from a stream, also handle non mime streams gracefullygetURLInputStream(String urlString) get the opened input stream for a given url stringgetXMLDoc(InputStream stream, int index) get the JDF Doc from a stream, also handle non mime streams gracefullyMethods inherited from class org.cip4.jdflib.util.mime.MimeHelper
getBodyPartHelper, getBodyParts, getCount, getCreatePartByCID, getCreatePartByLocalName, getMarkSize, getMultiPart, getPartByCID, getPartHelperByAttribute, getPartHelperByCID, getPartHelperByLocalName, setMarkSize
-
Constructor Details
-
MimeReader
public MimeReader() -
MimeReader
public MimeReader(jakarta.mail.Multipart mp) create a reader from an existing mutipart- Parameters:
mp-
-
MimeReader
create a root multipart from an input stream- Parameters:
mimeStream- the input stream
-
MimeReader
create a root multipart from a MimeWriter- Parameters:
writer- the input writer that will now be read
-
MimeReader
create a root multipart from an input stream- Parameters:
url- the url or file name
-
MimeReader
create a root multipart from an input stream- Parameters:
url- the url or file name
-
-
Method Details
-
getJDFDoc
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
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
get the opened input stream for a given url string- Parameters:
urlString-- Returns:
-
getFileName
- Parameters:
url-- Returns:
-