org.cip4.jdflib.util.mime
Class MimeReader

java.lang.Object
  extended by org.cip4.jdflib.util.mime.MimeHelper
      extended by org.cip4.jdflib.util.mime.MimeReader

public class MimeReader
extends MimeHelper

Author:
Dr. Rainer Prosi, Heidelberger Druckmaschinen AG Jul 24, 2009

Field Summary
 
Fields inherited from class org.cip4.jdflib.util.mime.MimeHelper
markSize, theMultipart
 
Constructor Summary
MimeReader()
           
MimeReader(InputStream mimeStream)
          create a root multipart from an input stream
MimeReader(MimeWriter writer)
          create a root multipart from a MimeWriter
MimeReader(javax.mail.Multipart mp)
          create a reader from an existing mutipart
MimeReader(String url)
          create a root multipart from an input stream
 
Method Summary
 String getFileName(String url)
           
 JDFDoc getJDFDoc(InputStream stream, int index)
          get the JDF Doc from a stream, also handle non mime streams gracefully
 InputStream getURLInputStream(String urlString)
          get the opened input stream for a given url string
 XMLDoc getXMLDoc(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, getMarkSize, getMultiPart, getPartByCID, getPartHelperByCID, setMarkSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MimeReader

public MimeReader()

MimeReader

public MimeReader(javax.mail.Multipart mp)
create a reader from an existing mutipart

Parameters:
mp -

MimeReader

public MimeReader(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(String url)
create a root multipart from an input stream

Parameters:
url - the url or file name
Method Detail

getJDFDoc

public JDFDoc getJDFDoc(InputStream stream,
                        int index)
get the JDF Doc from a stream, also handle non mime streams gracefully

Parameters:
stream - the stream to search in
index - 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(InputStream stream,
                        int index)
get the JDF Doc from a stream, also handle non mime streams gracefully

Parameters:
stream - the stream to search in
index - the index of the body part to search
Returns:
JDFDoc the parsed xml JDFDoc, null if stream does not contain xml

getURLInputStream

public InputStream getURLInputStream(String urlString)
get the opened input stream for a given url string

Parameters:
urlString -
Returns:

getFileName

public String getFileName(String url)
Parameters:
url -
Returns:


Copyright © 2013. All Rights Reserved.