[BACKLOG-133] Tree rest call file filtering does not work properly

Please add some javadoc here describing the behavior of the method.