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

com.nepxion.discovery.common.util.UrlUtil Maven / Gradle / Ivy

Go to download

Nepxion Discovery is a solution for Spring Cloud with blue green, gray, weight, limitation, circuit breaker, degrade, isolation, monitor, tracing, dye, failover, async agent

There is a newer version: 6.22.0
Show newest version
package com.nepxion.discovery.common.util;

/**
 * 

Title: Nepxion Discovery

*

Description: Nepxion Discovery

*

Copyright: Copyright (c) 2017-2050

*

Company: Nepxion

* @author Haojun Ren * @version 1.0 */ import org.apache.commons.lang3.StringUtils; public class UrlUtil { public static String formatUrl(String url) { if (!url.startsWith("http://")) { url = "http://" + url; } if (!url.endsWith("/")) { url = url + "/"; } return url; } public static String formatContextPath(String contextPath) { if (StringUtils.isEmpty(contextPath)) { return "/"; } else { if (!contextPath.startsWith("/")) { contextPath = "/" + contextPath; } if (!contextPath.endsWith("/")) { contextPath = contextPath + "/"; } } return contextPath; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy