Java Path File Check nio isValidPath(String path)

Here you can find the source of isValidPath(String path)

Description

is Valid Path

License

Open Source License

Declaration

public static boolean isValidPath(String path) 

Method Source Code

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

import java.nio.file.InvalidPathException;
import java.nio.file.Paths;

public class Main {
    public static boolean isValidPath(String path) {
        try {//ww  w  .j  ava 2 s .  co m
            Paths.get(path);
        } catch (InvalidPathException ex) {
            return false;
        }
        return true;
    }
}

Related

  1. isValidDirectory(String path)
  2. isValidFileType(Path filePath)
  3. isValidHomeDirectory(final Path path)
  4. isValidPath(String path)
  5. isValidPath(String path)
  6. isValidRootArgument(Path argument)
  7. isValidWildFlyHome(final Path path)
  8. isVideo(Path p)
  9. isZip(Path path)