Ejemplo n.º 1
0
 /**
  * Runs uninstallation via the console.
  *
  * @param args the command line arguments
  */
 public static void consoleUninstall(String[] args) {
   UninstallerContainer container = new ConsoleUninstallerContainer();
   try {
     Destroyer destroyer = container.getComponent(Destroyer.class);
     boolean force = false;
     for (String arg : args) {
       if (arg.equals("-f")) {
         force = true;
       }
     }
     System.out.println("Force deletion: " + force);
     destroyer.setForceDelete(force);
     destroyer.run();
   } catch (Exception err) {
     shutdown(container, err);
   }
 }
Ejemplo n.º 2
0
 private static void shutdown(UninstallerContainer container, Exception error) {
   logger.log(Level.SEVERE, error.getMessage(), error);
   container.getComponent(Housekeeper.class).shutDown(1);
 }