Commits

David Carr  committed dff19de

Issue #2: fix IllegalArgumentException on supported file types in pages dir

  • Participants
  • Parent commits 7782f49

Comments (0)

Files changed (2)

File grails-app/conf/ZZZPageResources.groovy

  */
 
 import org.codehaus.groovy.grails.commons.ApplicationHolder
+import org.grails.plugin.resource.ResourceProcessor
 import org.slf4j.LoggerFactory
 
 def log = LoggerFactory.getLogger('org.grails.plugin.resource.page.PageResources')
 def application = ApplicationHolder.application
+ResourceProcessor grailsResourceProcessor = application.mainContext.getBean('grailsResourceProcessor')
 
 modules = {
     // This file should be named such that it comes alphabetically after any *Resources files that contain explicit
                 }
             } else {
                 File[] files = moduleDir.listFiles(
-                    [accept: { File f -> f.isFile() }] as FileFilter
+                    [accept: { File file ->
+                        if (file.isFile()) {
+                            def url = file.path.substring(prefixLen)
+                            if (grailsResourceProcessor.getDefaultSettingsForURI(url)) {
+                                return true
+                            } else {
+                                log.info("Ignoring file of unsupported type: ${url}")
+                                return false
+                            }
+                        } else {
+                            return false
+                        }
+                    }] as FileFilter
                 ).sort()
                 if (files.length > 0) {
                     if (log.isInfoEnabled()) {

File src/docs/guide/releaseNotes.gdoc

 Below is the history of Page Resource plugin releases.
 
+h4. 0.1.2 (Release TBD)
+* Fixed IllegalArgumentException on unsupported files in pages directory ( "Issue #2":https://github.com/davidmc24/grails-page-resources/issues/2 )
+
 h4. 0.1.1 (Released 7-18-2012)
 * Fixed IllegalArgumentException on Windows ( "Issue #1":https://github.com/davidmc24/grails-page-resources/issues/1 )