public static boolean isFileExist(String filePath){
  File f=new File(filePath);
  return f.exists() && !f.isDirectory();
}

public static boolean isFileExist ( String filePath ) { File f = new File ( filePath ) ; return f . exists ( ) && ! f . isDirectory ( ) ; }
checks if is file exist .
