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());