FileDocCategorySizeDatePackage
multipart_mixed.javaAPI DocJavaMail 1.4.33796Tue Nov 17 10:38:10 GMT 2009com.sun.mail.handlers

multipart_mixed

public class multipart_mixed extends Object implements DataContentHandler

Fields Summary
private ActivationDataFlavor
myDF
Constructors Summary
Methods Summary
public java.lang.ObjectgetContent(javax.activation.DataSource ds)
Return the content.

	try {
	    return new MimeMultipart(ds); 
	} catch (MessagingException e) {
	    IOException ioex =
		new IOException("Exception while constructing MimeMultipart");
	    ioex.initCause(e);
	    throw ioex;
	}
    
public java.lang.ObjectgetTransferData(java.awt.datatransfer.DataFlavor df, javax.activation.DataSource ds)
Return the Transfer Data of type DataFlavor from InputStream.

param
df The DataFlavor
param
ins The InputStream corresponding to the data
return
String object

	// use myDF.equals to be sure to get ActivationDataFlavor.equals,
	// which properly ignores Content-Type parameters in comparison
	if (myDF.equals(df))
	    return getContent(ds);
	else
	    return null;
    
public java.awt.datatransfer.DataFlavor[]getTransferDataFlavors()
Return the DataFlavors for this DataContentHandler.

return
The DataFlavors


                  
        // throws Exception;
	return new DataFlavor[] { myDF };
    
public voidwriteTo(java.lang.Object obj, java.lang.String mimeType, java.io.OutputStream os)
Write the object to the output stream, using the specific MIME type.

	if (obj instanceof MimeMultipart) {
	    try {
		((MimeMultipart)obj).writeTo(os);
	    } catch (MessagingException e) {
		throw new IOException(e.toString());
	    }
	}