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

global.maplink.env.Environment Maven / Gradle / Ivy

The newest version!
package global.maplink.env;

import java.net.MalformedURLException;
import java.net.URL;

public interface Environment {

    String getHost();

    default URL withService(String servicePath) {
        String parsed = servicePath.trim();
        if (!parsed.startsWith("/")) {
            parsed = "/" + parsed;
        }
        try {
            return new URL(getHost() + parsed);
        } catch (MalformedURLException e) {
            throw new RuntimeException(e);
        }
    }

    static Environment loadDefault() {
        return EnvironmentCatalog.PRODUCTION;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy