1 package org.columba.mail.attachment.handler.example; 2 import java.awt.Toolkit ; 3 import java.io.IOException ; 4 5 import org.columba.mail.gui.attachment.IAttachmentContext; 6 import org.columba.mail.gui.attachment.IAttachmentHandler; 7 8 public class MyExampleHandler implements IAttachmentHandler { 9 10 public MyExampleHandler() { 11 } 12 13 public void execute(IAttachmentContext context) 14 throws IllegalArgumentException { 15 16 System.out.println("filename="+context.getFileName()); 17 try { 18 System.out.println("inputstream length="+context.getContent().available()); 19 } catch (IOException e) { 20 e.printStackTrace(); 21 } 22 23 Toolkit kit = Toolkit.getDefaultToolkit(); 25 kit.beep(); 26 } 27 28 } 29 | Popular Tags |