Java Path Concatenate concatPath(String... path)

Here you can find the source of concatPath(String... path)

Description

concat Path

License

Apache License

Declaration

public static String concatPath(String... path) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static String concatPath(String... path) {
        String finalPath = "";
        for (String item : path) {
            if (item.startsWith("/")) {
                finalPath = finalPath.concat(item);
            } else {
                finalPath = finalPath.concat("/").concat(item);
            }//from ww  w . j  av  a  2 s .com
        }
        return finalPath;
    }
}

Related

  1. concatPath(String path1, String path2)
  2. concatPath(String pathName, String name)
  3. concatPath(String root, String fragment)
  4. concatPath(String root, String node)
  5. concatPath(String src, String dst)
  6. concatPaths(String path1, String path2)
  7. concatPaths(String path1, String path2)
  8. concatPaths(String prefix, String postfix)
  9. concatPathsStrings(String head, String tail)