Hi Danny,
> I get a NullerPointerException using the code below
> (java GetFilesByExt
> C:\\New txt). {Note: New.txt is a file under my C:\
> directory}. I thought if
> I supply (1) a directory to a path and (2) an
> extension then the class would
> return all the file-names under that directory
> having such an extension. Is
> my interpretation incorect?
You need to pass in the base directory as a first
argument and not the base name of a file, that is,
change c:\\New to c:\\ . That should work.
If you don't pass in an existing directory, you
will end up with a NullPointer exception.
- Gerald
|