CB-7715 Fix windows build if folder has '.(js|htm|etc)' in name

https://issues.apache.org/jira/browse/CB-7715

* Updated regexp to match file name end and ignore case
* Additional check to make sure we are processing file