file io - How to Check Path is existing or not in java? -


I have a Java program that takes the argument. I want to check whether the path present before the other presence is present or not. Example: If I give a path D: \ Log \ sampling that does not exist, then it has to throw the filenafety exception. How can i do

  if (new file ("D: \\ log \\ sample") exists ()) {New file notfound exception ("weird!"); }  

Besides, there are more here.


Comments