This tool constructs a simple MIME multipart document from a set of "parts". It accepts as input a standard properties object (file) describing the operations to be performed. The location of the properties file is the only parameter.
tool CreateMultipart <path to properties file>
The properties file must contain the required property out.name, with a value of the path to the multipart document to be constructed.
A group of properties named inX.<propertyname> describes each "part" to be included, where X is replaced with the part number 1 to n. The required property name for each in part has a value of the path containing the data to be included in the part. Any other properties to be copied to the message part are expressed as header properties. For example,
out.name=c:/testarea/testmp.mpart # part 1 is an XML document as a header in1.name=c:/testarea/testmp.xml in1.header.Content-Type=application/xml #part 2 is the information part one describes in2.name=c:/testarea/test.txt in2.header.Content-Type=text/document in2.header.Content-Id: mydata
The content of the XML part for our example is
<mydoc> <request> <user>user1</user> <password>password1</password> <route>COPY</route> <input type='attach'/> </request> </mydoc>
Running the tool command tool
CreateMultipart c:/testarea/testmp
produces this file:
message-id: <7754670.1104164220167.JavaMail.rb02237@Beck2000> content-type: multipart/mixed; boundary="----=_Part_1_7835377.1104164220042" content-length: 593 mime-version: 1.0 ------=_Part_1_7835377.1104164220042 Content-Type: application/xml Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=testmp.xml
<mydoc> <request> <user>user1</user> <password>password1</password> <route>COPY</route> <input type='attach'/> </request> </mydoc> ------=_Part_1_7835377.1104164220042 Content-Type: text/document Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=test.txt Content-Id: mydata This is a test of the multipart tool ------=_Part_1_7835377.1104164220042–--
iWay Software |