public static boolean fileExists(String fName){
  boolean result=false;
  File file=new File(fName);
  if (file != null) {
    result=file.exists() && file.isFile();
  }
  return result;
}

public static boolean fileExists ( String fName ) { boolean result = false ; File file = new File ( fName ) ; if ( file != null ) { result = file . exists ( ) && file . isFile ( ) ; } return result ; }
test if a file exists or not
