Changeset 1017 in josm


Ignore:
Timestamp:
Oct 5, 2008 12:46:09 PM (5 years ago)
Author:
stoecker
Message:

close bug #1627

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/plugins/PluginDownloader.java

    r873 r1017  
    173173                File pluginDir = Main.pref.getPluginsDirFile(); 
    174174                boolean ok = true;               
    175                 if (pluginDir.exists() && pluginDir.isDirectory()) { 
     175                if (pluginDir.exists() && pluginDir.isDirectory() && pluginDir.canWrite()) { 
    176176                        final File[] files = pluginDir.listFiles(new FilenameFilter() { 
    177177                                public boolean accept(File dir, String name) { 
     
    181181                                final String filePath = updatedPlugin.getPath(); 
    182182                                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; 
    184184                        } 
    185185                } 
Note: See TracChangeset for help on using the changeset viewer.