Here you can find the source of concatPaths(String prefix, String postfix)
Parameter | Description |
---|---|
prefix | a parameter |
postfix | a parameter |
public static String concatPaths(String prefix, String postfix)
//package com.java2s; //License from project: Apache License public class Main { /**//from w w w. jav a 2 s.co m * Concatenates two paths using forward slashes. * * @param prefix * @param postfix * @return the concatenation */ public static String concatPaths(String prefix, String postfix) { String result = prefix; if (!result.endsWith("/")) { result += "/"; } result += postfix.startsWith("/") ? postfix.substring(1) : postfix; return result; } }