code: public void sparseCheckout(String branch, String path) throws Exception {
          fetch(); // in case the branch is not known locally
          hardReset();
          checkout(branch);
          pull(branch);  // pull before delete or next pull may add non-path items back
  
          // delete non-path items
          List<File> preserveList = new ArrayList<File>();
          preserveList.add(new File(localDir + "/.git"));
          preserveList.add(new File(localDir + "/" + path));
          new Delete(localDir, true).run();
      }
docs: Actually a workaround since JGit does not support sparse checkout:
  https://bugs.eclipse.org/bugs/show_bug.cgi?id=383772.
  Performs a HARD reset and FORCED checkout then deletes non-path items.
  Only to be used on server (not Designer).