Here you can find the source of combine(final String path1, final String path2)
public static String combine(final String path1, final String path2)
//package com.java2s; //License from project: Open Source License public class Main { public static String combine(final String path1, final String path2) { if (path1.endsWith("/") || path1.endsWith(System.getProperty("file.separator"))) { return path1 + path2; } else {//from w ww . ja v a2s . com return path1 + System.getProperty("file.separator") + path2 + System.getProperty("file.separator"); } } public static String combine(final String path1, final String path2, final String path3) { return combine(combine(path1, path2), path3); } public static String combine(final String path1, final String path2, final String path3, final String path4) { return combine(combine(path1, path2), combine(path3, path4)); } }