public class LocalDirectoryLister extends AbstractDirectoryLister
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.DirectoryLister.Entry
Constructor and Description |
---|
LocalDirectoryLister() |
Modifier and Type | Method and Description |
---|---|
protected java.util.List |
buildEntryList(java.lang.String name)
Builds the list of directory entries.
|
java.lang.String |
getChild(java.lang.String parent,
java.lang.String child)
Gets the full child directory name for the specified parent and
child.
|
java.lang.String |
getParent(java.lang.String name)
Gets the parent directory name for the specified directory.
|
static void |
main(java.lang.String[] argv)
Tests this class.
|
clear, clone, getDirectory, getEntries, refresh, setDirectory
public java.lang.String getParent(java.lang.String name)
DirectoryLister
name
- the name of the directory to get the parent.public java.lang.String getChild(java.lang.String parent, java.lang.String child)
DirectoryLister
parent
- the parent base directory.child
- the child directory within the parent.protected java.util.List buildEntryList(java.lang.String name) throws java.io.IOException
AbstractDirectoryLister
buildEntryList
in class AbstractDirectoryLister
java.io.IOException
- if an error occurred getting the entries for
the new directory.public static void main(java.lang.String[] argv) throws java.lang.Exception
argv
- the array of command line parameters.java.lang.Exception