...so, the caller has to have specialized knowledge about this function anyway, as you note with your final line: "for the case of searching the 'common' folder", you have to invoke this differently -- which is the same as saying "to use this, you need to understand that internally the common directory is unique".

Having the boolean and an internal condition is definitely ugly, and suggests that this should either (a) be several different functions, or (b) have the caller just supply the data.

(The caller, in this case, is code that exists only in this same class, by the way; in that world, where you put down the extension is just an implementation detail, not something visible to the outside world. :)