private boolean isValidFile(File file){
  return (file != null && file.isDirectory() && file.canRead() && file.canWrite());
}

private boolean isValidFile ( File file ) { return ( file != null && file . isDirectory ( ) && file . canRead ( ) && file . canWrite ( ) ) ; }
returns true if the selected file or directory would be valid selection .
