Java File Path Create buildPath(String... strings)

Here you can find the source of buildPath(String... strings)

Description

Builds a file path by concatenating the single strings and separating them with the system specific file separator character.

License

Open Source License

Parameter

Parameter Description
strings a parameter

Declaration

public static String buildPath(String... strings) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**/*from w w  w . j a v  a2  s  .  co  m*/
     * Builds a file path by concatenating the single strings and separating
     * them with the system specific file separator character.
     * 
     * @param strings
     * @return
     */
    public static String buildPath(String... strings) {
        StringBuilder sb = new StringBuilder();
        for (String s : strings) {
            if (sb.length() != 0)
                sb.append(System.getProperty("file.separator"));
            sb.append(s);
        }
        return sb.toString();
    }
}

Related

  1. buildPath(long id, boolean justDir)
  2. buildPath(String first, String... parts)
  3. buildPath(String part1, String part2)
  4. buildPath(String path, String file)
  5. buildPath(String... paths)
  6. buildPath(String[] seperatedName)
  7. buildPathArray(String xpath)
  8. buildPathString(String[] folders, boolean addDefaultValues)
  9. buildPathToApiTargetFolder(String apiPackageName, String path)