Here you can find the source of concatPath(String path0, String path1)
public static final String concatPath(String path0, String path1)
//package com.java2s; //License from project: Open Source License public class Main { public static final String concatPath(String path0, String path1) { if (path0 == null || path0.length() == 0) { return path1; }/* w w w .j a va2 s . c o m*/ if (path1 == null || path1.length() == 0) { return path0; } if (path0.endsWith("/")) { if (path1.startsWith("/")) { return path0 + path1.substring(1); } else { return path0 + path1; } } else { if (path1.startsWith("/")) { return path0 + path1; } else { return path0 + "/" + path1; } } } }