private static File extract()

in iep-launcher/src/main/java/com/netflix/iep/launcher/Main.java [102:123]


  private static File extract(File loc) throws Exception {
    boolean clean = Boolean.parseBoolean(System.getProperty(Settings.CLEAN_WORKING_DIR, "true"));

    if (loc.isDirectory()) {
      log("already extracted, using directory: " + loc);
      return loc;
    } else {
      String dflt = System.getProperty("user.home") + "/.iep-launcher/" + loc.getName();
      String path = System.getProperty(Settings.WORKING_DIR);
      path = (path == null) ? dflt : path;
      File dir = new File(path);

      if (clean && dir.isDirectory()) {
        log("already extracted, but " + Settings.CLEAN_WORKING_DIR + "=true, deleting " + dir);
        delete(dir);
      }

      dir.mkdirs();
      extractJar(loc, dir);
      return dir;
    }
  }