01: package org.columba.mail.attachment.handler.example;
02:
03: import java.awt.Toolkit;
04: import java.io.IOException;
05:
06: import org.columba.mail.gui.attachment.IAttachmentContext;
07: import org.columba.mail.gui.attachment.IAttachmentHandler;
08:
09: public class MyExampleHandler implements IAttachmentHandler {
10:
11: public MyExampleHandler() {
12: }
13:
14: public void execute(IAttachmentContext context)
15: throws IllegalArgumentException {
16:
17: System.out.println("filename=" + context.getFileName());
18: try {
19: System.out.println("inputstream length="
20: + context.getContent().available());
21: } catch (IOException e) {
22: e.printStackTrace();
23: }
24:
25: // system beep
26: Toolkit kit = Toolkit.getDefaultToolkit();
27: kit.beep();
28: }
29:
30: }
|