Dump the content of the passed in BodyPart to the file fileName.
//
// print mime type of compressed content
//
System.out.println("content type: " + bodyPart.getContentType());
//
// recover the compressed content
//
OutputStream out = new FileOutputStream(fileName);
InputStream in = bodyPart.getInputStream();
byte[] buf = new byte[10000];
int len;
while ((len = in.read(buf, 0, buf.length)) > 0)
{
out.write(buf, 0, len);
}
out.close();