alexo/wro4j — pull request #44 by SomMeri (2012-05-17 14:19:00+00:00)
Title: WildcardExpanderModelTransformer problem with /** url

If the resource in a group uses deep wilcard and starts at the root, then the WildcardExpanderModelTransformer can not find referenced resources.

Example: The following group:

/**.css
/**.js

would be empty.

More details: If the "ie.css" file is located in "resources/" directory, preprocessor executor looks for "//resources/ie.css" which does not exists. It should look for "/resources/ie.css" instead.

The problem is in the createExpanderHandler method of WildcardExpanderModelTransformer. It uses FilenameUtils.getFullPathNoEndSeparator to get the resource path without the last slash. This method is unwilling to return an empty string. E.g.:
* FilenameUtils.getFullPathNoEndSeparator("/resources/**.css") returns "/resources
* FilenameUtils.getFullPathNoEndSeparator("/**.css") returns "/"

Note: Following group works correcty:

/resources/**.css
/resources/**.js