diff --git a/G-Earth/src/main/java/gearth/services/internal_extensions/extensionstore/application/entities/extensiondetails/StoreExtensionDetailsOverview.java b/G-Earth/src/main/java/gearth/services/internal_extensions/extensionstore/application/entities/extensiondetails/StoreExtensionDetailsOverview.java index 0f11226..aa594c1 100644 --- a/G-Earth/src/main/java/gearth/services/internal_extensions/extensionstore/application/entities/extensiondetails/StoreExtensionDetailsOverview.java +++ b/G-Earth/src/main/java/gearth/services/internal_extensions/extensionstore/application/entities/extensiondetails/StoreExtensionDetailsOverview.java @@ -120,7 +120,7 @@ public class StoreExtensionDetailsOverview extends HOverview { @Override public void buttonClick(GExtensionStore gExtensionStore) { int mode = mode(); - if (mode == 2) return; + if (mode == 1) return; String modeString = mode() == 0 ? "Install" : "Update"; HOverview selff = this; @@ -149,7 +149,7 @@ public class StoreExtensionDetailsOverview extends HOverview { if (mode() == 0) { StoreExtensionTools.installExtension(extension.getTitle(), storeRepository, listener); } - else if (mode() == 1) { + else if (mode() == 2) { StoreExtensionTools.updateExtension(extension.getTitle(), storeRepository, listener); } } diff --git a/G-Earth/src/main/java/gearth/services/internal_extensions/extensionstore/tools/StoreExtensionTools.java b/G-Earth/src/main/java/gearth/services/internal_extensions/extensionstore/tools/StoreExtensionTools.java index e809c63..a235209 100644 --- a/G-Earth/src/main/java/gearth/services/internal_extensions/extensionstore/tools/StoreExtensionTools.java +++ b/G-Earth/src/main/java/gearth/services/internal_extensions/extensionstore/tools/StoreExtensionTools.java @@ -142,10 +142,14 @@ public class StoreExtensionTools { } catch (MalformedURLException e) { listener.fail("Invalid extension URL"); - removeExtension(path); // cleanup + try { + removeExtension(path); // cleanup + } catch (IOException ignore) { } } catch (IOException e) { listener.fail("Extension not available in repository"); - removeExtension(path); // cleanup + try { + removeExtension(path); // cleanup + } catch (IOException ignore) { } } } else { @@ -161,12 +165,8 @@ public class StoreExtensionTools { } - public static void removeExtension(String extensionPath) { - try { - FileUtils.deleteDirectory(new File(extensionPath)); - } catch (IOException e) { - e.printStackTrace(); - } + public static void removeExtension(String extensionPath) throws IOException { + FileUtils.deleteDirectory(new File(extensionPath)); } public static List getInstalledExtension() {