Add optional parameter exclude to getFolders, which contains folders to
exclude.