Class AbstractDirectoryLister

java.lang.Object
noaa.coastwatch.gui.open.AbstractDirectoryLister
All Implemented Interfaces:
Cloneable, DirectoryLister
Direct Known Subclasses:
HTTPDirectoryLister, LocalDirectoryLister

public abstract class AbstractDirectoryLister extends Object implements DirectoryLister, Cloneable
The AbstractDirectoryLister is an abstract helper that implements most of the DirectoryLister methods. Child classes need only implement:
Since:
3.2.0
Author:
Peter Hollemans
  • Constructor Details

    • AbstractDirectoryLister

      public AbstractDirectoryLister()
      Creates a new lister with empty directory name.
  • Method Details

    • getDirectory

      public String getDirectory()
      Gets the directory name.
      Specified by:
      getDirectory in interface DirectoryLister
      Returns:
      name the directory name or null if no directory is set.
    • clone

      public Object clone()
      Gets a copy of this object.
      Specified by:
      clone in interface DirectoryLister
      Overrides:
      clone in class Object
    • setDirectory

      public void setDirectory(String name) throws IOException
      Sets the directory name.
      Specified by:
      setDirectory in interface DirectoryLister
      Parameters:
      name - the new directory name.
      Throws:
      IOException - if an error occurred getting the entries for the new directory.
    • buildEntryList

      protected abstract List buildEntryList(String name) throws IOException
      Builds the list of directory entries.
      Throws:
      IOException - if an error occurred getting the entries for the new directory.
    • refresh

      public void refresh() throws IOException
      Refreshes the entry list based on the current directory name.
      Specified by:
      refresh in interface DirectoryLister
      Throws:
      IOException - if an error occurred getting the entries for the new directory.
    • clear

      public void clear()
      Clears the directory name and entry list.
      Specified by:
      clear in interface DirectoryLister
    • getEntries

      public List getEntries()
      Gets the list of directory entries.
      Specified by:
      getEntries in interface DirectoryLister