code: protected Map<String, List<CmsResource>> createFolderLookupMap(List<CmsResource> resources) {
  
          Map<String, List<CmsResource>> result = new HashMap<String, List<CmsResource>>(128);
          Iterator<CmsResource> i = resources.iterator();
          while (i.hasNext()) {
              CmsResource res = i.next();
              String folderPath = CmsResource.getFolderPath(res.getRootPath());
              List<CmsResource> folderContent = result.get(folderPath);
              if (folderContent == null) {
                  folderContent = new ArrayList<CmsResource>(32);
                  result.put(folderPath, folderContent);
              }
              folderContent.add(res);
          }
  
          return result;
      }
docs: Creates a folder based lookup map for the given resource list.<p>
  
  @param resources the list of resource to build the lookup map for
  
  @return a folder based lookup map for the given resource list