FileDocCategorySizeDatePackage
MimeHandler.javaAPI DocExample2039Sat Oct 26 10:34:28 BST 2002None

MimeHandler

public class MimeHandler extends Object
Provide a truly minimalist demonstration of using JAF (aka javax.activation, the Java Activation Framework) to read one object and classify it.

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

		MimeHandler mh = new MimeHandler();

		mh.process(args[0]);
	
private voidprocess(java.lang.String fn)

		DataSource ds = new FileDataSource(fn);

		DataHandler dh = new DataHandler(ds);

		dh.setDataContentHandlerFactory(new MyDataContentHandlerFactory());

		Object data = dh.getContent();

		System.out.println("Content=" + data);
		if (data != null)
			System.out.println("Type   =" + data.getClass().getName());