docs: @Nonnull
      public static String normalizeFile(@Nonnull String path, String extension) {
          path = path.replace("\\", "/");
          if (path.startsWith("/")) {
              path = path.substring(1);
          }
          if (extension != null && !extension.startsWith(".")) {
              extension = "." + extension;
              if (path.endsWith(extension)) {
                  int idx = path.indexOf(extension);
                  path = path.substring(0, idx);
              }
          }
          return path;
      }