Changeset 282 in josm for src/org/openstreetmap/josm/plugins


Ignore:
Timestamp:
2007-07-08T00:32:06+02:00 (17 years ago)
Author:
imi
Message:
  • fixed exception when download link of plugins doesn't work
File:
1 edited

Legend:

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

    r277 r282  
    7575    }
    7676
    77         public static void downloadPlugin(PluginDescription pd) {
     77        public static boolean downloadPlugin(PluginDescription pd) {
    7878                File file = new File(Main.pref.getPreferencesDir()+"plugins/"+pd.name+".jar");
    7979            try {
     
    8585                out.close();
    8686                in.close();
     87                try {
     88                    PluginInformation.findPlugin(pd.name);
     89                    return true;
     90            } catch (Exception e) {
     91                    e.printStackTrace();
     92                    JOptionPane.showMessageDialog(Main.parent, tr("The plugin {0} seem to be broken or could not be downloaded automatically.", pd.name));
     93            }
    8794        } catch (Exception e) {
    88                 if (file.exists())
    89                         file.delete();
    9095                JOptionPane.showMessageDialog(Main.parent, tr("Could not download plugin: {0} from {1}", pd.name, pd.resource));
    9196        }
     97        if (file.exists())
     98                file.delete();
     99        return false;
    92100    }
    93101}
Note: See TracChangeset for help on using the changeset viewer.