@Override
   public String buildRemoteURL(String baseRepositoryURL, String referencePath) {
      // https://gitlab.com/api/v4/projects/35980862/repository/files/folder%2Fsubfolder%2Ffilename/raw?ref=branch

      // https://gitlab.com/api/v4/projects/35980862/repository/files
      String rootURL = baseRepositoryURL.substring(0,
            baseRepositoryURL.indexOf(REPOSITORY_FILES_MARKER) + REPOSITORY_FILES_MARKER.length() - 1);

      // folder%2Fsubfolder%2Ffilename
      String basePath = baseRepositoryURL.substring(
            baseRepositoryURL.indexOf(REPOSITORY_FILES_MARKER) + REPOSITORY_FILES_MARKER.length(),
            baseRepositoryURL.lastIndexOf("/"));

      // raw?ref=branch
      String formatOptions = baseRepositoryURL.substring(baseRepositoryURL.lastIndexOf("/") + 1);

      // Now do a simple reference url build. We need to ensure that there's a root
      // by adding a starting /. We'll remove it after the build when recomposing result.
      String pathFragment = super.buildRemoteURL("/" + URLDecoder.decode(basePath, StandardCharsets.UTF_8),
            referencePath);

      return rootURL + "/" + URLEncoder.encode(pathFragment.substring(1), StandardCharsets.UTF_8) + "/" + formatOptions;
   }
@Test
   void testBuildRemoteURL() {
      GitLabReferenceURLBuilder builder = new GitLabReferenceURLBuilder();

      assertEquals("https://gitlab.com/api/v4/projects/35980862/repository/files/pastry%2Fschema-ref.yml/raw?ref=main",
            builder.buildRemoteURL(BASE_URL, "schema-ref.yml"));
      assertEquals("https://gitlab.com/api/v4/projects/35980862/repository/files/pastry%2Fschema-ref.yml/raw?ref=main",
            builder.buildRemoteURL(BASE_URL, "./schema-ref.yml"));
      assertEquals("https://gitlab.com/api/v4/projects/35980862/repository/files/refs%2Fschema-ref.yml/raw?ref=main",
            builder.buildRemoteURL(BASE_URL, "../refs/schema-ref.yml"));
   }