docs: @Trivial
      private static String stripPath(String path) {
          int pathLen = path.length();
  
          if ( pathLen == 0 ) {
              return path;
  
          } else if ( pathLen == 1 ) {
              if ( path.charAt(0) == '/' ) {
                  return "";
              } else {
                  return path;
              }
  
          } else {
              if ( path.charAt(0) == '/' ) {
                  if ( path.charAt(pathLen - 1) == '/' ) {
                      return path.substring(1,  pathLen - 1);
                  } else {
                      return path.substring(1, pathLen);
                  }
              } else {
                  if ( path.charAt(pathLen - 1) == '/' ) {
                      return path.substring(0, pathLen - 1);
                  } else {
                      return path;
                  }
              }
          }
      }