Here you can find the source of isPathExists(String path)
Parameter | Description |
---|---|
path | a str of dir path |
public static boolean isPathExists(String path)
//package com.java2s; import java.io.File; public class Main { /**// www. j ava 2 s. c om * judge a path has existed * * @param path a str of dir path * @return if dir has existed then return true otherwise return false */ public static boolean isPathExists(String path) { if (path == null || path.isEmpty()) { throw new IllegalArgumentException( "the arg: path can not be null or empty"); } return new File(path).exists(); } }