com.github.yoojia.halo.utils.URIs Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of halo-core Show documentation
Show all versions of halo-core Show documentation
A FAST && THIN && HIGH SCALABLE Java web framework
package com.github.yoojia.halo.utils;
/**
* @author YOOJIA.CHEN ([email protected])
*/
public class URIs {
public static String combined(String root, String path){
final boolean starts = path.startsWith("/");
final boolean ends = root.endsWith("/");
final String uri;
if(ends && starts){
uri = root + path.substring(1);
}else{
uri = root + (ends || starts ? "" : "/") + path;
}
return uri;
}
}