Here you can find the source of concatPath(String root, String node)
public static String concatPath(String root, String node)
//package com.java2s; //License from project: Apache License public class Main { public static final String NODE_SEPERATOR = "/"; public static String concatPath(String root, String node) { if (root == null) { root = NODE_SEPERATOR;//from w w w. j a v a 2 s . c o m } if (!root.startsWith(NODE_SEPERATOR)) { throw new RuntimeException("path should be start with a /"); } if (!root.endsWith(NODE_SEPERATOR)) { root = root + NODE_SEPERATOR; } return root + node; } }