Here you can find the source of isValidDirectory(String path)
Parameter | Description |
---|---|
path | a parameter |
public static boolean isValidDirectory(String path)
//package com.java2s; //License from project: Apache License import java.nio.file.Files; import java.nio.file.Paths; public class Main { /**//from w ww. j a v a 2 s .c o m * Determines whether given path is a valid directory * @param path * @return true if path is a valid directory */ public static boolean isValidDirectory(String path) { return path.length() > 0 & path.charAt(0) == '/' & Files.isDirectory(Paths.get(path)); } }