Class MimeReader

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

public class MimeReader extends MimeHelper
  • Constructor Details

    • MimeReader

      public MimeReader()
    • MimeReader

      public MimeReader(jakarta.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
    • MimeReader

      public MimeReader(File file)
      create a root multipart from an input stream
      Parameters:
      url - the url or file name
  • Method Details

    • 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: