Changeset 1017 in josm for trunk/src/org/openstreetmap/josm/plugins
- Timestamp:
- 2008-10-05T12:46:09+02:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/plugins/PluginDownloader.java
r873 r1017 173 173 File pluginDir = Main.pref.getPluginsDirFile(); 174 174 boolean ok = true; 175 if (pluginDir.exists() && pluginDir.isDirectory() ) {175 if (pluginDir.exists() && pluginDir.isDirectory() && pluginDir.canWrite()) { 176 176 final File[] files = pluginDir.listFiles(new FilenameFilter() { 177 177 public boolean accept(File dir, String name) { … … 181 181 final String filePath = updatedPlugin.getPath(); 182 182 File plugin = new File(filePath.substring(0, filePath.length() - 4)); 183 ok = plugin.delete() && updatedPlugin.renameTo(plugin) && ok;183 ok = (plugin.delete() || !plugin.exists()) && updatedPlugin.renameTo(plugin) && ok; 184 184 } 185 185 }
Note:
See TracChangeset
for help on using the changeset viewer.