Changeset 291 in josm
- Timestamp:
- 2007-07-19T11:51:22+02:00 (18 years ago)
- Location:
- src/org/openstreetmap/josm/plugins
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/plugins/Plugin.java
r267 r291 92 92 93 93 /** 94 * @deprecated Use copy(String pluginName, String from, String to) instead 95 */ 96 @Deprecated public void copy(String from, String to) throws FileNotFoundException, IOException { 97 copy(name, from, to); 98 } 99 100 /** 94 101 * Copies the ressource 'from' to the file in the plugin directory named 'to'. 95 102 */ 96 public void copy(String from, String to) throws FileNotFoundException, IOException { 97 File pluginDir = new File(getPluginDir()); 103 public void copy(String pluginName, String from, String to) throws FileNotFoundException, IOException { 104 String pluginDirName = Main.pref.getPreferencesDir()+"plugins/"+pluginName+"/"; 105 File pluginDir = new File(pluginDirName); 98 106 if (!pluginDir.exists()) 99 107 pluginDir.mkdirs(); 100 FileOutputStream out = new FileOutputStream( getPluginDir()+to);108 FileOutputStream out = new FileOutputStream(pluginDirName+to); 101 109 InputStream in = getClass().getResourceAsStream(from); 102 110 byte[] buffer = new byte[8192]; -
src/org/openstreetmap/josm/plugins/PluginInformation.java
r277 r291 187 187 return all; 188 188 } 189 190 191 /** 192 * Return information about a loaded plugin. 193 * 194 * Note that if you call this in your plugins bootstrap, you may get <code>null</code> if 195 * the plugin requested is not loaded yet. 196 * 197 * @return The PluginInformation to a specific plugin, but only if the plugin is loaded. 198 * If it is not loaded, <code>null</code> is returned. 199 */ 200 public static PluginInformation getLoaded(String pluginName) { 201 for (PluginProxy p : Main.plugins) 202 if (p.info.name.equals(pluginName)) 203 return p.info; 204 return null; 205 } 189 206 } 190 207
Note:
See TracChangeset
for help on using the changeset viewer.