Java File Path Create buildPathString(String[] folders, boolean addDefaultValues)

Here you can find the source of buildPathString(String[] folders, boolean addDefaultValues)

Description

build Path String

License

Open Source License

Declaration

protected static String buildPathString(String[] folders, boolean addDefaultValues) 

Method Source Code

//package com.java2s;

public class Main {
    protected static final String JAVA_LIBRARY_PATH = "java.library.path";

    protected static String buildPathString(String[] folders, boolean addDefaultValues) {
        String del = System.getProperty("path.separator");
        StringBuffer path = new StringBuffer();

        if (null != folders && folders.length > 0) {
            for (String folder : folders) {
                path.append(folder).append(del);
            }//  w ww .jav a 2s  . com
        }
        if (addDefaultValues) {
            path.append(".").append(del); // append current directory
            path.append(System.getProperty("user.dir")).append(del);
            path.append(System.getProperty(JAVA_LIBRARY_PATH));
        }

        return path.toString();
    }
}

Related

  1. buildPath(String path, String file)
  2. buildPath(String... paths)
  3. buildPath(String... strings)
  4. buildPath(String[] seperatedName)
  5. buildPathArray(String xpath)
  6. buildPathToApiTargetFolder(String apiPackageName, String path)
  7. filePath(String compchartimage)
  8. filePath(String dirPath, String fileName)
  9. filePath2PackageName(String entryName)