public void unloadAndDelete(SmallModuleEntry sme) { UploaderPlugin up; synchronized (this) { up = sme.up; sme.up = null; // deactivate initiated here if (up == null) { Path zipPath = UploaderPlugin.getLocalPath(updateLocation, sme); if (Files.exists(zipPath)) { try { Files.delete(zipPath); } catch (Exception a) { System.out.println("could not delete unactive plugin " + sme.getName()); } } return; } } try { up.destroy(); } catch (Exception a) { System.out.println("could not destory plugin " + sme.getName()); a.printStackTrace(); } }
private void deleteLocal(SmallModuleEntry sme) { Path localCopyPath = UploaderPlugin.getLocalPath(updateLocation, sme); try { Files.deleteIfExists(localCopyPath); } catch (IOException a) { a.printStackTrace(); } }