Java Path Create makePath(Collection files)

Here you can find the source of makePath(Collection files)

Description

make Path

License

Apache License

Declaration

public static String makePath(Collection<File> files) 

Method Source Code

//package com.java2s;
// Licensed under the Apache License, Version 2.0 (the "License");

import java.io.File;

import java.util.Arrays;
import java.util.Collection;

public class Main {
    public static String makePath(File... files) {
        return makePath(Arrays.asList(files));
    }// w ww .  ja v  a2 s .  com

    public static String makePath(Collection<File> files) {
        return makePath(files, File.pathSeparator);
    }

    public static String makePath(Collection<File> files, String pathSeparator) {
        StringBuilder result = new StringBuilder();

        for (File file : files) {
            if (result.length() != 0) {
                result.append(pathSeparator);
            }

            result.append(file.getPath());
        }

        return result.toString();
    }
}

Related

  1. makePath(File copyTo)
  2. makePath(File cwd, String path)
  3. makePath(final String dir, final String... jars)
  4. makePath(String basePath)