public I_CmsResourceType getResourceType(CmsResource resource) {

        I_CmsResourceType result = m_configuration.getResourceTypeById(resource.getTypeId());
        if (result == null) {
            // this resource type is unknown, return the default files instead
            if (resource.isFolder()) {
                // resource is a folder
                if (m_restypeUnknownFolder != null) {
                    result = m_restypeUnknownFolder;
                } else {
                    result = m_configuration.getResourceTypeByName(CmsResourceTypeFolder.getStaticTypeName());
                }
            } else {
                // resource is a file
                if (m_restypeUnknownFile != null) {
                    result = m_restypeUnknownFile;
                } else {
                    result = m_configuration.getResourceTypeByName(CmsResourceTypeBinary.getStaticTypeName());
                }
            }
        }
        return result;
    }
public I_CmsResourceType getResourceType ( CmsResource resource ) { I_CmsResourceType result = m_configuration . getResourceTypeById ( resource . getTypeId ( ) ) ; if ( result == null ) { if ( resource . isFolder ( ) ) { if ( m_restypeUnknownFolder != null ) { result = m_restypeUnknownFolder ; } else { result = m_configuration . getResourceTypeByName ( CmsResourceTypeFolder . getStaticTypeName ( ) ) ; } } else { if ( m_restypeUnknownFile != null ) { result = m_restypeUnknownFile ; } else { result = m_configuration . getResourceTypeByName ( CmsResourceTypeBinary . getStaticTypeName ( ) ) ; } } } return result ; }
Convenience method to get the initialized resource type instance for the given resource,
with a fall back to special "unknown" resource types in case the resource type is not configured.<p>

@param resource the resource to get the type for

@return the initialized resource type instance for the given resource