1 //The contents of this file are subject to the Mozilla Public License Version 1.1 2 //(the "License"); you may not use this file except in compliance with the 3 //License. You may obtain a copy of the License at http://www.mozilla.org/MPL/ 4 // 5 //Software distributed under the License is distributed on an "AS IS" basis, 6 //WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 7 //for the specific language governing rights and 8 //limitations under the License. 9 // 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 /** 34 * 35 * create temporary File which exists also when Columba is not running. 36 * 37 * This is useful when opening attachments with your web-browser. When you 38 * close Columba and use java's internal temp-file stuff, closing Columba 39 * would also close the web-browser. 40 * 41 * @return File 42 */ 43 public static File createTempFile() { 44 return TempFileStore.createTempFile(); 45 } 46 47 /** 48 * 49 * Returns config.xml file found in the plugin folder. 50 * 51 * @param pluginId 52 * id of your plugin 53 * 54 * @return XmlIO 55 */ 56 public static File getPluginConfigFile(String pluginId) { 57 return PluginManager.getInstance().getPluginConfigFile(pluginId); 58 } 59 60 /** 61 * Get background task manager. 62 * 63 * @return background task manager. 64 */ 65 public static IBackgroundTaskManager getBackgroundTaskManager() { 66 return (IBackgroundTaskManager) BackgroundTaskManager.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 }