Optimized checks on resource file types

This optimization was suggested by David Naramski on the Bonita community Jira:
https://bonita.atlassian.net/browse/BBPMC-112