Java Path Create toPath(String... paths)

Here you can find the source of toPath(String... paths)

Description

to Path

License

Open Source License

Declaration

public static final String toPath(String... paths) 

Method Source Code

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

public class Main {
    public static final String toPath(String... paths) {

        StringBuilder builder = new StringBuilder();

        for (String path : paths) {

            if (path.endsWith("/")) {
                path = path.substring(0, path.length() - 1);
            }// w  w  w  .ja  v a 2  s . co  m

            if (path.startsWith("/")) {
                builder.append(path);
            } else {
                builder.append("/" + path);
            }

        }

        return builder.toString();
    }
}

Related

  1. toPath(Object[] path)
  2. toPath(String groupId)
  3. toPath(String id)
  4. toPath(String pathName)
  5. toPath(String srcPath, boolean nodeModelSource)
  6. toPath(String[] array)
  7. toPathIndex(String fileName)
  8. toPathName(String name)
  9. toPathPart(String fileName)