Create a file handle from the path and use the File's list method to get a list of files under that directory.
Then check the files.
If directory
call the method passing the file path
else
process the file as you require.
That should be simple enough.