code: public static boolean isGrailsResource(Resource r) {
          try {
              String file = r.getURL().getFile();
              return isGrailsPath(file) || file.endsWith("GrailsPlugin.groovy");
          }
          catch (IOException e) {
              return false;
          }
      }
docs: Checks whether the specific resources is a Grails resource. A Grails resource is a Groovy or Java class under the grails-app directory
  
  @param r The resource to check
  @return True if it is a Grails resource