Here you can find the source of combinePath(String... paths)
Parameter | Description |
---|---|
paths | a parameter |
public static String combinePath(String... paths)
//package com.java2s; /*----------------------------------------------------------------------------- * GDSC SMLM Software// ww w. j av a 2 s.c o m * * Copyright (C) 2016 Alex Herbert * Genome Damage and Stability Centre * University of Sussex, UK * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. *---------------------------------------------------------------------------*/ import java.io.File; public class Main { /** * Combine the arguments into a complete file path * * @param paths * @return The file path */ public static String combinePath(String... paths) { File file = new File(paths[0]); for (int i = 1; i < paths.length; i++) { file = new File(file, paths[i]); } return file.getPath(); } }