public static boolean fileExists(File file){
  return file.exists() && !file.isDirectory();
}

public static boolean fileExists ( File file ) { return file . exists ( ) && ! file . isDirectory ( ) ; }
check if file exists and is not a directory
