Replace long parameter list w/ object

Extract the DirectoryParams object as a parameter in the
getDirectory(...) method. This allows to reduce the number of
parameters in getDirectory.