protected Map<String, CmsResource> getResourcesByRelativePath(List<CmsResource> resources, String basePath) {

        Map<String, CmsResource> result = new HashMap<String, CmsResource>();
        for (CmsResource resource : resources) {
            String relativeSubPath = CmsStringUtil.getRelativeSubPath(basePath, resource.getRootPath());
            if (relativeSubPath != null) {
                result.put(relativeSubPath, resource);
            }
        }
        return result;
    }
protected Map < String , CmsResource > getResourcesByRelativePath ( List < CmsResource > resources , String basePath ) { Map < String , CmsResource > result = new HashMap < String , CmsResource > ( ) ; for ( CmsResource resource : resources ) { String relativeSubPath = CmsStringUtil . getRelativeSubPath ( basePath , resource . getRootPath ( ) ) ; if ( relativeSubPath != null ) { result . put ( relativeSubPath , resource ) ; } } return result ; }
Collects a list of resources in a map where the key for each resource is the path relative to a given folder.<p>

@param resources the resources to put in the map
@param basePath the path relative to which the keys of the resulting map should be computed

@return a map from relative paths to resources