Java Path Create nio toPath(String value, Path defaultValue)

Here you can find the source of toPath(String value, Path defaultValue)

Description

to Path

License

Apache License

Declaration

public static Path toPath(String value, Path defaultValue) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.nio.file.Path;
import java.nio.file.Paths;

public class Main {
    public static Path toPath(String value, Path defaultValue) {
        if (value == null || value.length() == 0) {
            return defaultValue;
        }// w  w  w  . j  ava2  s .  c om

        return Paths.get(value);
    }
}

Related

  1. setTimes(FileTime lastModifiedTime, FileTime lastAccessTime, FileTime createTime, Path... files)
  2. toPath(@Nullable String plain)
  3. toPath(String first, String... more)
  4. toPath(String path)
  5. toPath(String uri, Path root)
  6. toPathArray(File... files)
  7. toPaths(File... files)
  8. toPaths(Iterable files)
  9. toRealPath(Path path)