Here you can find the source of mergepath(List
static String mergepath(List<String> pieces, String separator)
//package com.java2s; /*//from w w w . ja v a2 s. c om This software is released under the Licence terms described in the file LICENSE.txt. */ import java.util.List; public class Main { static String mergepath(List<String> pieces, String separator) { StringBuilder buf = new StringBuilder(); for (int i = 0; i < pieces.size(); i++) { if (i > 0) buf.append(separator); buf.append(pieces.get(i)); } return buf.toString(); } }