Here you can find the source of combinePath(String basePath, String withPath)
public static String combinePath(String basePath, String withPath)
//package com.java2s; // License: https://servicestack.net/bsd-license.txt public class Main { public static String combinePath(String basePath, String withPath) { if (basePath == null) basePath = ""; if (withPath == null) withPath = ""; String prefix = basePath.endsWith("/") ? basePath : basePath + "/"; String suffix = withPath.startsWith("/") ? withPath.substring(1) : withPath; return prefix + suffix; }//www . j a va 2s .co m }