docs: public static String getParent(String path) {
          String parent = null;
          int lastIndex = path.lastIndexOf('/');
          if (lastIndex != -1) {
              if (path.length() == 1) {
                  parent = null;
              } else if (lastIndex == 0) {
                  parent = "/";
              } else {
                  parent = path.substring(0, lastIndex);
              }
          }
          return parent;
  
      }