Returns if the given resource is a model group resource.<p>

@param resource the resource

@return <code>true</code> if the given resource is a model group resource
977403
public static boolean isModelGroupResource(CmsResource resource) {

        return CmsResourceTypeXmlContainerPage.MODEL_GROUP_TYPE_NAME.equals(
            OpenCms.getResourceManager().getResourceType(resource).getTypeName());
    }
147555
public static boolean isRenderableFile(Resource resource) {
        boolean result = false;
        try {
            Node node = resource.adaptTo(Node.class);
            if (node != null) {
                NodeType type = node.getPrimaryNodeType();
                if (ResourceUtil.TYPE_FILE.equals(type.getName())) {
                    String resoureName = resource.getName();
                    result = resoureName.toLowerCase().endsWith(LinkUtil.EXT_HTML);
                }
            }
        } catch (RepositoryException e) {
            // ok, not renderable
        }
        return result;
    }
139477
public Set<ResourceMethod> getMethods(final String resource) {
        return Collections.unmodifiableSet(resources.get(resource));
    }
760734
public static Collection<URL> findResources(final String resource) {
        final Collection<UrlResource> urlResources = findUrlResources(resource);
        final Collection<URL> resources = new LinkedHashSet<>(urlResources.size());
        for (final UrlResource urlResource : urlResources) {
            resources.add(urlResource.getUrl());
        }
        return resources;
    }
1128589
public static boolean isResourcesOfResource(JavaType type) {

		return
			CollectionModel.class.isAssignableFrom(type.getRawClass())
			&&
			EntityModel.class.isAssignableFrom(type.containedType(0).getRawClass());
	}
425177
@Override
	public boolean handles(String mid, IResource resource) {
		Matcher m = re.matcher(mid);
		return super.handles(mid, resource) &&
				m.matches() && m.group(5).length() == 0;
	}
1114593
@Nullable
	private static CollectionJsonTemplate findTemplate(RepresentationModel<?> resource) {

		if (!resource.hasLink(IanaLinkRelations.SELF)) {
			return null;
		}

		return resource.getRequiredLink(IanaLinkRelations.SELF).getAffordances() //
				.stream() //
				.map(it -> it.getAffordanceModel(MediaTypes.COLLECTION_JSON)) //
				.map(CollectionJsonAffordanceModel.class::cast) //
				.filter(it -> !it.hasHttpMethod(HttpMethod.GET)) //
				.map(it -> new CollectionJsonTemplate().withData(it.getInputProperties())) //
				.findFirst().orElse(null);
	}
104517
public boolean contains(String resource) {
		boolean result = storage.contains(resource);
		logger.debug("resource '{}' {} in cache", resource, (result ? "is" : "is not"));
		return result; 
	}
627031
protected boolean isResourceInTimeWindow(CmsPublishedResource resource) {

        return m_cms.existsResource(
            m_cms.getRequestContext().removeSiteRoot(resource.getRootPath()),
            CmsResourceFilter.DEFAULT);
    }
107045
public function hasResource($resource) {

		if(null !== $resource && false === is_string($resource)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($resource)), E_USER_ERROR);
		}

		return true === array_key_exists($resource, $this -> resources);
	}
392727
public PagedList<MediaServiceInner> listByResourceGroup(String resourceGroupName) {
        PageImpl<MediaServiceInner> page = new PageImpl<>();
        page.setItems(listByResourceGroupWithServiceResponseAsync(resourceGroupName).toBlocking().single().body());
        page.setNextPageLink(null);
        return new PagedList<MediaServiceInner>(page) {
            @Override
            public Page<MediaServiceInner> nextPage(String nextPageLink) {
                return null;
            }
        };
    }
773033
public CmsLocaleGroup readDefaultFileLocaleGroup(CmsResource resource) throws CmsException {

        if (resource.isFolder()) {
            CmsResource defaultFile = m_cms.readDefaultFile(resource, CmsResourceFilter.IGNORE_EXPIRATION);
            if (defaultFile != null) {
                return readLocaleGroup(defaultFile);
            } else {
                LOG.warn("default file not found, reading locale group of folder.");
            }
        }
        return readLocaleGroup(resource);

    }
445160
private CmsContainerElementBean getModelBaseElement(
        CmsContainerPageBean modelGroupPage,
        CmsResource modelGroupResource) {

        CmsContainerElementBean result = null;
        for (CmsContainerElementBean element : modelGroupPage.getElements()) {
            if (CmsContainerElement.ModelGroupState.isModelGroup.name().equals(
                element.getIndividualSettings().get(CmsContainerElement.MODEL_GROUP_STATE))) {
                result = element;
                break;
            }
        }
        return result;
    }
1116580
public int countResourcesInGroup(I_CmsPublishResourceCheck check, List<CmsPublishResource> group) {

        int result = 0;
        for (CmsPublishResource res : group) {
            if (check.check(res)) {
                result += 1;
            }
        }
        return result;

    }
1338327
public static boolean isNavLevelFolder(CmsObject cms, CmsResource resource) {

        if (resource.isFolder()) {
            I_CmsResourceType type = OpenCms.getResourceManager().getResourceType(resource);
            if (CmsResourceTypeFolder.RESOURCE_TYPE_NAME.equals(type.getTypeName())) {
                try {
                    CmsProperty prop = cms.readPropertyObject(
                        resource,
                        CmsPropertyDefinition.PROPERTY_DEFAULT_FILE,
                        false);
                    return !prop.isNullProperty() && NAVIGATION_LEVEL_FOLDER.equals(prop.getValue());
                } catch (CmsException e) {
                    LOG.debug(e.getMessage(), e);
                }
            }
        }
        return false;
    }
152130
public List<CmsModelPageEntry> getModelGroups() {

        List<CmsModelPageEntry> result = new ArrayList<CmsModelPageEntry>();
        CmsResourceTypeConfig config = m_adeConfig.getResourceType(
            CmsResourceTypeXmlContainerPage.MODEL_GROUP_TYPE_NAME);
        if ((config != null) && !config.isDisabled()) {
            String modelGroupFolderPath = config.getFolderPath(m_cms, m_adeConfig.getBasePath());
            if (m_cms.existsResource(modelGroupFolderPath)) {
                try {
                    Locale wpLocale = OpenCms.getWorkplaceManager().getWorkplaceLocale(m_cms);
                    List<CmsResource> modelResources = m_cms.readResources(
                        modelGroupFolderPath,
                        CmsResourceFilter.ONLY_VISIBLE_NO_DELETED.addRequireType(
                            OpenCms.getResourceManager().getResourceType(
                                CmsResourceTypeXmlContainerPage.MODEL_GROUP_TYPE_NAME)),
                        false);
                    for (CmsResource model : modelResources) {
                        CmsModelPageEntry entry = createModelPageEntry(model, false, false, wpLocale);
                        if (entry != null) {
                            result.add(entry);
                        }
                    }
                } catch (CmsException e) {
                    LOG.error(e.getLocalizedMessage(), e);
                }
            }
        }
        return result;
    }
912726
public static boolean isJavaFile(IResource resource) {
        if (resource == null || (resource.getType() != IResource.FILE)) {
            return false;
        }
        String ex = resource.getFileExtension();
        return "java".equalsIgnoreCase(ex); //$NON-NLS-1$
    }