contents.clear(); directories = 0; FileSystemView fsv = filechooser.getFileSystemView(); File[] list = fsv.getFiles(filechooser.getCurrentDirectory(), filechooser.isFileHidingEnabled());  if (list == null) return;  for (int i = 0; i < list.length; i++)
File dir = filechooser.getCurrentDirectory(); if (dir != null)
  public void validateFileCache()  {    contents.clear();    directories = 0;    FileSystemView fsv = filechooser.getFileSystemView();    File[] list = fsv.getFiles(filechooser.getCurrentDirectory(),                               filechooser.isFileHidingEnabled());    if (list == null)      return;    for (int i = 0; i < list.length; i++)      {	if (list[i] == null)	  continue;	if (filechooser.accept(list[i]))	  {	    contents.add(list[i]);	    if (filechooser.isTraversable(list[i]))	      directories++;	  }      }    sort(contents);    filechooser.revalidate();    filechooser.repaint();  }