{
val result = new ArrayList<String>(64);
// maintain a queue of scanned directories
val directoryQueue = new LinkedList<String>();
directoryQueue.addLast(path);
// check if we need to add self
if (includeDirectories)
result.addAll(Linq.toList(Linq.select(hideScanned(new File[] {new File(path)}, hiddenMode, failMode, collectedScanErrors),
getAbsolutePath())));