KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > columba > mail > folder > command > ImportMessageCommand


1 /*
2  * Created on 24.03.2003
3  *
4  * To change this generated comment go to
5  * Window>Preferences>Java>Code Generation>Code and Comments
6  */

7 package org.columba.mail.folder.command;
8
9 import org.columba.api.command.ICommandReference;
10 import org.columba.api.command.IWorkerStatusController;
11 import org.columba.core.command.Command;
12 import org.columba.mail.command.ImportFolderCommandReference;
13 import org.columba.mail.folder.mailboximport.AbstractMailboxImporter;
14
15 /**
16  * Import messages to folder.
17  * <p>
18  * This command is used by the mail import wizard to import messages. All the
19  * interesting work happens in {@link AbstractMailboxImporter}.
20  * <p>
21  * Note, that the import wizard needs a command to make sure that the folder is
22  * locked.
23  *
24  * @author fdietz
25  */

26 public class ImportMessageCommand extends Command {
27     /**
28      * @param references
29      */

30     public ImportMessageCommand(ICommandReference reference) {
31         super(reference);
32     }
33
34     /*
35      * (non-Javadoc)
36      *
37      * @see org.columba.api.command.Command#execute(org.columba.api.command.Worker)
38      */

39     public void execute(IWorkerStatusController worker) throws Exception JavaDoc {
40         ImportFolderCommandReference r = (ImportFolderCommandReference) getReference();
41
42         AbstractMailboxImporter importer = r.getImporter();
43
44         importer.run(worker);
45     }
46 }
Popular Tags