All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.quorum.tessera.partyinfo.URLNormalizer Maven / Gradle / Ivy

Go to download

Tessera is a stateless Java system that is used to enable the encryption, decryption, and distribution of private transactions for Quorum.

There is a newer version: 24.4.2
Show newest version
package com.quorum.tessera.partyinfo;

import java.net.URI;
import java.net.URISyntaxException;

public interface URLNormalizer {

    default String normalize(String url) {
        try {
            final URI uri = new URI(url).normalize();
            if (uri.getPath().isEmpty()) {
                return url + "/";
            }
        } catch (URISyntaxException ex) {
            throw new RuntimeException(String.format("Invalid URL %s", url));
        }
        return url;
    }

    static URLNormalizer create() {
        return new URLNormalizer() {
        };
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy