Java Path Create nio toPaths(File... files)

Here you can find the source of toPaths(File... files)

Description

Converts the given files to a sequence of paths.

License

Open Source License

Parameter

Parameter Description
files the files

Return

the paths

Declaration

private static Iterable<Path> toPaths(File... files) 

Method Source Code


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

import java.io.File;

import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;

public class Main {
    /**/*from  w w w  . j av  a2  s . co m*/
     * Converts the given files to a sequence of paths.
     *
     * @param files the files
     * @return the paths
     */
    private static Iterable<Path> toPaths(File... files) {
        List<Path> paths = new ArrayList<>(files.length);
        for (File file : files) {
            paths.add(file.toPath());
        }
        return paths;
    }
}

Related

  1. toPath(String first, String... more)
  2. toPath(String path)
  3. toPath(String uri, Path root)
  4. toPath(String value, Path defaultValue)
  5. toPathArray(File... files)
  6. toPaths(Iterable files)
  7. toRealPath(Path path)