Package noaa.coastwatch.gui.open
Class LocalDirectoryLister
java.lang.Object
noaa.coastwatch.gui.open.AbstractDirectoryLister
noaa.coastwatch.gui.open.LocalDirectoryLister
- All Implemented Interfaces:
Cloneable
,DirectoryLister
The
LocalDirectoryLister
lists directory contents on
the local filesystem. This class is mainly useful as a test
implementation of the DirectoryLister
class, as the
JFileChooser
provides more extensive directory listing
services in a GUI format. The directory name must be an existing
local path convertible into a java.io.File
object.- Since:
- 3.2.0
- Author:
- Peter Hollemans
-
Nested Class Summary
Nested classes/interfaces inherited from interface noaa.coastwatch.gui.open.DirectoryLister
DirectoryLister.Entry
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List
buildEntryList
(String name) Builds the list of directory entries.Gets the full child directory name for the specified parent and child.Gets the parent directory name for the specified directory.static void
Tests this class.Methods inherited from class noaa.coastwatch.gui.open.AbstractDirectoryLister
clear, clone, getDirectory, getEntries, refresh, setDirectory
-
Constructor Details
-
LocalDirectoryLister
public LocalDirectoryLister()
-
-
Method Details
-
getParent
Description copied from interface:DirectoryLister
Gets the parent directory name for the specified directory.- Parameters:
name
- the name of the directory to get the parent.- Returns:
- the parent directory. If the directory has no parent, the directory itself is returned.
-
getChild
Description copied from interface:DirectoryLister
Gets the full child directory name for the specified parent and child.- Parameters:
parent
- the parent base directory.child
- the child directory within the parent.- Returns:
- the full child directory as a concatentation of parent and child.
-
buildEntryList
Description copied from class:AbstractDirectoryLister
Builds the list of directory entries.- Specified by:
buildEntryList
in classAbstractDirectoryLister
- Throws:
IOException
- if an error occurred getting the entries for the new directory.
-
main
Tests this class.- Parameters:
argv
- the array of command line parameters.- Throws:
Exception
-