code: public static String getDefaultGridMapLocation() {
          String location = System.getProperty("GRIDMAP");
          if (location == null || location.length() == 0) {
              String uid = null;
              try {
                  uid = ConfigUtil.getUID();
              } catch (IOException e) {
                  // ignore it
              }
              if (uid != null && uid.equals("0")) {
                  location = "/etc/grid-security/grid-mapfile";
              } else {
                  location = System.getProperty("user.home") + "/.gridmap";
              }
          }
          return location;
      }
docs: /*
  Determine the location of the gridmap file based on the standard
  Globus logic:
  1. If the GRIDMAP system property is set, return it.
  2. If the user is not root, return $HOME/.gridmap
  3. Otherwise, return /etc/grid-security/grid-mapfile