Here you can find the source of combinePaths(String[] paths)
public static String combinePaths(String[] paths)
//package com.java2s; /* This file is part of Openrouteservice. * * Openrouteservice is free software; you can redistribute it and/or modify it under the terms of the * GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 * of the License, or (at your option) any later version. //from www .jav a 2 s . com * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public License along with this library; * if not, see <https://www.gnu.org/licenses/>. */ import java.io.File; public class Main { public static String combinePaths(String[] paths) { if (paths.length == 0) { return ""; } File combined = new File(paths[0]); int i = 1; while (i < paths.length) { combined = new File(combined, paths[i]); ++i; } return combined.getPath(); } }