01: //The contents of this file are subject to the Mozilla Public License Version 1.1
02: //(the "License"); you may not use this file except in compliance with the
03: //License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
04: //
05: //Software distributed under the License is distributed on an "AS IS" basis,
06: //WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
07: //for the specific language governing rights and
08: //limitations under the License.
09: //
10: //The Original Code is "The Columba Project"
11: //
12: //The Initial Developers of the Original Code are Frederik Dietz and Timo Stich.
13: //Portions created by Frederik Dietz and Timo Stich are Copyright (C) 2003.
14: //
15: //All Rights Reserved.
16: package org.columba.core.facade;
17:
18: import java.io.File;
19:
20: import org.columba.api.backgroundtask.IBackgroundTaskManager;
21: import org.columba.api.plugin.IPluginManager;
22: import org.columba.core.backgroundtask.BackgroundTaskManager;
23: import org.columba.core.plugin.PluginManager;
24: import org.columba.core.util.TempFileStore;
25:
26: /**
27: * @author fdietz
28: */
29: public class Facade {
30:
31: /**
32: *
33: * create temporary File which exists also when Columba is not running.
34: *
35: * This is useful when opening attachments with your web-browser. When you
36: * close Columba and use java's internal temp-file stuff, closing Columba
37: * would also close the web-browser.
38: *
39: * @return File
40: */
41: public static File createTempFile() {
42: return TempFileStore.createTempFile();
43: }
44:
45: /**
46: *
47: * Returns config.xml file found in the plugin folder.
48: *
49: * @param pluginId
50: * id of your plugin
51: *
52: * @return XmlIO
53: */
54: public static File getPluginConfigFile(String pluginId) {
55: return PluginManager.getInstance()
56: .getPluginConfigFile(pluginId);
57: }
58:
59: /**
60: * Get background task manager.
61: *
62: * @return background task manager.
63: */
64: public static IBackgroundTaskManager getBackgroundTaskManager() {
65: return (IBackgroundTaskManager) BackgroundTaskManager
66: .getInstance();
67: }
68:
69: /**
70: * Get Plugin Manager;
71: *
72: * @return plugin manager;
73: */
74: public static IPluginManager getPluginManager() {
75: return (IPluginManager) PluginManager.getInstance();
76: }
77: }
|