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
979634
public static boolean isGrailsResource(Resource r) {
        try {
            String file = r.getURL().getFile();
            return isGrailsPath(file) || file.endsWith("GrailsPlugin.groovy");
        }
        catch (IOException e) {
            return false;
        }
    }
502461
public boolean isSearchClasspathForResources() {
        if (logger!=null)
            logger.logp(Level.INFO, CLASS_NAME,"isSearchClasspathForResources", "searchClasspathForResources: {"+searchClasspathForResources+"]");
        return searchClasspathForResources;
    }
821182
private static Resource nullSafeReadResource(final OperationContext context, final ImmutableManagementResourceRegistration registry) {

        Resource result;
        if (registry != null && registry.isRemote()) {
            try {
                // BES 2015/02/12 (WFCORE-539) -- following comment and use of 'true' I can't understand,
                // as the only use of 'resource' is to get the model or the children names,
                // neither of which needs the cloning behavior in OperationContextImpl.readResourceFromRoot

                //TODO check that having changed this from false to true does not break anything
                //If it does, consider adding a Resource.alwaysClone() method that can be used in
                //OperationContextImpl.readResourceFromRoot(final PathAddress address, final boolean recursive)
                //instead of the recursive check
                //result = context.readResource(PathAddress.EMPTY_ADDRESS, true);

                // BES 2015/02/12 -- So, back to 'false'
                result = context.readResource(PathAddress.EMPTY_ADDRESS, false);
            } catch (RuntimeException e) {
                result = PlaceholderResource.INSTANCE;
            }
        } else {
            // BES 2015/02/12 (WFCORE-539) -- following comment and use of 'true' I can't understand,
            // as the only use of 'resource' is to get the model or the children names,
            // neither of which needs the cloning behavior in OperationContextImpl.readResourceFromRoot

            //TODO check that having changed this from false to true does not break anything
            //If it does, consider adding a Resource.alwaysClone() method that can be used in
            //OperationContextImpl.readResourceFromRoot(final PathAddress address, final boolean recursive)
            //instead of the recursive check

            // BES 2015/02/12 -- So, back to 'false'
            result = context.readResource(PathAddress.EMPTY_ADDRESS, false);
        }
        return result;
    }
1364908
def is_domain_class_collection_attribute(ent, attr_name):
    
    attr = get_domain_class_attribute(ent, attr_name)
    return attr.kind == RESOURCE_ATTRIBUTE_KINDS.COLLECTION
1184671
@Override
	public boolean isDirectory(String path) {

		String resourcePath = getResolver().getResourcePath(path);
		return rsBrowser.isDirectory(resourcePath);
	}
873148
public static boolean isPluginResoucePath(String resourcePath) {

		Matcher matcher = PLUGIN_RESOURCE_PATTERN.matcher(resourcePath);
		return matcher.find();
	}
595849
public static boolean isQualifiedResourceUri(@Nullable Uri uri) {
    final String scheme = getSchemeOrNull(uri);
    return QUALIFIED_RESOURCE_SCHEME.equals(scheme);
  }
229876
public static boolean isGrailsPath(String path) {
        if(KNOWN_PATHS.containsKey(path)) {
            return KNOWN_PATHS.get(path);
        }
        for (Pattern grailsAppResourcePattern : grailsAppResourcePatterns) {
            Matcher m = grailsAppResourcePattern.matcher(path);
            if (m.find()) {
                KNOWN_PATHS.put(path, true);
                return true;
            }
        }
        KNOWN_PATHS.put(path, false);
        return false;
    }
721572
protected boolean containsResource(CmsResource res) {

        return m_deletedFolderList.contains(res) || m_folderList.contains(res) || m_fileList.contains(res);
    }
1319432
protected boolean resourceIsValid(CmsResource resource) {

        if (!resource.getRootPath().startsWith(m_basePath)) {
            return false;
        }
        if (m_requireFile & resource.isFolder()) {
            return false;
        }
        if (m_requireFolder & resource.isFile()) {
            return false;
        }
        return true;
    }
422006
def is_resource_class_terminal_attribute(rc, attr_name):
    
    attr = get_resource_class_attribute(rc, attr_name)
    return attr.kind == RESOURCE_ATTRIBUTE_KINDS.TERMINAL
198425
public static boolean isProjectSource(String path) {
        for (Pattern grailsAppResourcePattern : patterns) {
            Matcher m = grailsAppResourcePattern.matcher(path);
            if (m.find()) {
                return true;
            }
        }
        return false;
    }
104091
static boolean isServerOrHostController(ImmutableManagementResourceRegistration resourceRegistration) {
        return resourceRegistration.getProcessType().isServer() || !ModelDescriptionConstants.PROFILE.equals(resourceRegistration.getPathAddress().getElement(0).getKey());
    }
426899
protected boolean isInConditionResource(String resource){
		Resource sqlResource = context.getResource(resource);
		InputStream in = null;
		String sql = null;
		try{
			in = sqlResource.getInputStream();
			sql = IOUtils.toString(in);
		} catch(IOException ioe){
			throw new RuntimeException("Failed to get condition SQL (" + ioe.getMessage() + ") from: " + resource, ioe);
		}finally{
			IOUtils.closeQuietly(in);
		}
		if (StringUtils.isNotBlank(sql)){
			return isInCondition(sql);
		}else{
			return true;
		}
	}
43604
protected boolean isOperationOnMovedResource() {

        Iterator<String> i = getResourceList().iterator();
        while (i.hasNext()) {
            String resName = i.next();
            String target = resourceOriginalPath(getCms(), resName);
            if ((target != null) && !target.equals(resName)) {
                // found a moved resource
                return true;
            }
        }
        return false;
    }
534109
@Override
    public boolean isCollectionURI(final AtomRequest areq) {
        LOG.debug("isCollectionURI");
        // workspace/collection-plural
        // if length is 2 and points to a valid collection then YES
        final String[] pathInfo = StringUtils.split(areq.getPathInfo(), "/");
        if (pathInfo.length == 2) {
            final String handle = pathInfo[0];
            final String collection = pathInfo[1];
            if (service.findCollectionByHandle(handle, collection) != null) {
                return true;
            }
        }
        return false;

    }
439484
public String getResourceType() {
        if (resourceType == null) {
            resourceType = "";
            String type = resource.getResourceType();
            if (StringUtils.isBlank(type) || getPrimaryType().equals(type)) {
                Resource contentResource = getContentResource();
                if (contentResource != null) {
                    type = contentResource.getResourceType();
                    if (StringUtils.isNotBlank(type)) {
                        ResourceHandle handle = ResourceHandle.use(contentResource);
                        if (type.equals(handle.getPrimaryType())) {
                            type = null;
                        }
                    }
                }
            }
            if (StringUtils.isNotBlank(type)) {
                // check for a real existing resource type
                if (!Resource.RESOURCE_TYPE_NON_EXISTING.equals(type)) {
                    resourceType = type;
                }
            }
        }
        return resourceType;
    }