Class MimeWriter

    • Field Detail

      • log

        protected static final org.apache.commons.logging.Log log
    • Constructor Detail

      • MimeWriter

        public MimeWriter()
      • MimeWriter

        public MimeWriter​(javax.mail.Multipart mp)
        Parameters:
        mp -
    • Method Detail

      • getInputStream

        public java.io.InputStream getInputStream()
                                           throws java.io.IOException,
                                                  javax.mail.MessagingException
        gets an input s
        Returns:
        Throws:
        java.io.IOException
        javax.mail.MessagingException
      • createMimePackage

        public void createMimePackage()
        build an empty MIME package
      • updateMultipart

        public BodyPartHelper updateMultipart​(java.io.InputStream is,
                                              java.lang.String cid,
                                              java.lang.String contentType)
        Parameters:
        is -
        cid -
        contentType -
        Returns:
      • updateXMLMultipart

        public javax.mail.BodyPart updateXMLMultipart​(XMLDoc xmlDoc,
                                                      java.lang.String cid)
        Parameters:
        xmlDoc -
        cid -
        Returns:
      • writeToFile

        public java.io.File writeToFile​(java.lang.String fileName)
        write a Multipart to an output file
        Parameters:
        fileName - the file name
        Returns:
      • writeToDir

        public void writeToDir​(java.io.File directory)
                        throws javax.mail.MessagingException,
                               java.io.IOException
        write a Message to a directory
        Parameters:
        directory - the directory to use as '.' for writing the mime parts
        Throws:
        javax.mail.MessagingException
        java.io.IOException
        javax.mail.MessagingException
      • writeToStream

        public void writeToStream​(java.io.OutputStream outStream)
                           throws java.io.IOException,
                                  javax.mail.MessagingException
        write a Multipart to a Stream
        Parameters:
        outStream - the existing output stream, note that a buffered output stream is created in case outStream is unbuffered
        Throws:
        java.io.IOException
        javax.mail.MessagingException
      • writeToURL

        public UrlPart writeToURL​(java.lang.String strUrl)
                           throws java.io.IOException,
                                  javax.mail.MessagingException
        write a Multipart to an output URL File: and http: are currently supported Use HttpURLConnection.getInputStream() to retrieve the http response
        Parameters:
        strUrl - the URL to write to
        Returns:
        HttpURLConnection the opened http connection, null in case of error or file
        Throws:
        java.io.IOException
        javax.mail.MessagingException
      • buildMimePackage

        public void buildMimePackage​(java.util.Vector<? extends XMLDoc> vXMLDocs)
        Builds a MIME package.
        Parameters:
        vXMLDocs - the Vector of XMLDoc representing the JMF and JDFs to be stored as the first part of the package t
      • buildMimePackage

        public void buildMimePackage​(JDFDoc docJMF,
                                     XMLDoc docJDF,
                                     boolean extendReferenced)
        build a MIME package that contains all references in all FileSpecs of a given JDFDoc the doc is modified so that all URLs are cids
        Parameters:
        docJMF - the JDFDoc representation of the JMF that references the jdf to package, if null only the jdf is packaged note that the URL of docJDF must already be specified as a CID
        docJDF - the JDFDoc representation of the JDF to package
        extendReferenced - if true, also package any further reeferenced files
      • addBodyPart

        public void addBodyPart​(BodyPartHelper bph)
        Parameters:
        bph -
      • writeToQueue

        @Deprecated
        public JDFDoc writeToQueue​(JDFDoc docJMF,
                                   JDFDoc docJDF,
                                   java.lang.String strUrl)
                            throws java.io.IOException,
                                   javax.mail.MessagingException
        submit a multipart file to a queue
        Parameters:
        docJMF - the jmf document containing the submitqueueentry or resubmitqueueentry
        docJDF - the jdf to submit
        strUrl - the url to submit to
        Returns:
        Throws:
        java.io.IOException
        javax.mail.MessagingException
      • writeToQueue

        public JDFDoc writeToQueue​(JDFDoc docJMF,
                                   JDFDoc docJDF,
                                   java.lang.String strUrl,
                                   boolean extendRef)
                            throws java.io.IOException,
                                   javax.mail.MessagingException
        submit a multipart file to a queue
        Parameters:
        docJMF - the jmf document containing the submitqueueentry or resubmitqueueentry
        docJDF - the jdf to submit
        strUrl - the url to submit to
        extendRef - TODO
        Returns:
        Throws:
        java.io.IOException
        javax.mail.MessagingException
      • writeStream

        public void writeStream​(java.io.OutputStream os)
                         throws java.io.IOException
        Description copied from interface: IStreamWriter
        write myself to a stream
        Specified by:
        writeStream in interface IStreamWriter
        Parameters:
        os - the output stream
        Throws:
        java.io.IOException - if io snafu...